angular-geocomplete

WebJar for angular-geocomplete

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks Geo Business Logic Libraries Geospatial
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

angular-geocomplete
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

angular-geocomplete
WebJar for angular-geocomplete
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/ghostbar/angular-geocomplete

Download angular-geocomplete

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-geocomplete/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-geocomplete</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-geocomplete/
implementation 'org.webjars.bower:angular-geocomplete:0.1.0'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-geocomplete/
implementation ("org.webjars.bower:angular-geocomplete:0.1.0")
'org.webjars.bower:angular-geocomplete:jar:0.1.0'
<dependency org="org.webjars.bower" name="angular-geocomplete" rev="0.1.0">
  <artifact name="angular-geocomplete" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-geocomplete', version='0.1.0')
)
libraryDependencies += "org.webjars.bower" % "angular-geocomplete" % "0.1.0"
[org.webjars.bower/angular-geocomplete "0.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

angular-geocomplete

Simple Angular.js factory that gets GeoData from Google Maps's API with a simple name of a City or an Address.

It returns arrays of data and as much options are available for the query. It has two methods: cities and citiesJSON.

The first one returns an array with just a String with the following data and format: "City Name, State Name or abbreviature, Country Name".

The second method returns an array with a bunch more data formatted as the Google Maps's API does.

More docs on the code.

Usage

Install with bower:

bower install angular-geocomplete --save

Add to your HTML files:

<script src='/bower_components/angular-geocomplete/angular-geocomplete.js'></script>

Now, inject to your application:

angular.module('myApp', ['geocomplete']);

Ready to use in your controllers!:

controller.js:

// using callbacks
var DemoCtrl = [ '$scope', 'geoComplete', function ($scope, geoComplete) {
  geoComplete.cities("San Francisco", function (results) {
    $scope.results = results;
  });
}];

// using promises
var DemoCtrl = [ '$scope', 'geoComplete', function ($scope, geoComplete) {
  geoComplete.cities("San Francisco").then(function (results) {
    $scope.results = results;
  });
}];

Demo

  1. Plunker: http://plnkr.co/edit/yatsd3Cqg0te6TPMpjLV?p=preview
  2. Local: Run gulp to run tests, generate coverage and load demo or gulp serve to just load the demo. (a browser window will automatically open to http://localhost:8000)

Tests

  • Run gulp test
  • Coverage is generated in the coverage/ folder

Author

© 2014, Jose Luis Rivas <[email protected]>.

Contributors

Sha Alibhai (@shalotelli)

License

The files are licensed under the MIT terms.

Versions

Version
0.1.0