AngularJS Provider for working with the HERE Maps API
-
Add the
eyecatch.heremaps
module to your app:angular.module('MyApp', ['eyecatch.heremaps'])
-
Inject the
heremaps
provider to your controller/directive/module:angular.module('MyApp', [ 'eyecatch.heremaps']) .run(function ($rootScope, $state, $stateParams, $angularCacheFactory, $http, $log, heremaps) { ... }
-
Add HERE Maps config inside the
run
method aboveheremaps.appId("xyz"); heremaps.appCode("xyz");
-
Subscribe to the
heremaps-loaded
message on the$rootScope
that indicates that the map resources are ready$rootScope.$on('heremaps-loaded', function () { $scope.map = new nokia.maps.map.Display('mapContainerID', { components: [ new nokia.maps.map.component.Behavior() ], zoomLevel: 4, center: [64, 10] }); });
There are currently 3 events that you can subscribe to:
heremaps-initialized
The map script has been loaded, but not configured
heremaps-loaded
The map features have been loaded, and the map can be configured with appId, appCode, etc.
heremaps-error
An error occured while loading the map script
-
Fork the repository
-
Run
npm install
to install dependencies -
To test your contribution, run
grunt
-
When all tests are passing, run
grunt build
to minify all files -
Submit a pull request.
Initial release