While we are grateful for all the original work at tombatossals/angular-leaflet-directive. We need to be able to operate as an organization to respond to issues, pull-requests and other various items quicker. We need to be able to add other developers as admins easier via group permissions via github orgs. Lastly this project needs to be more credible via being a group / org.
Browse all the examples added by the community to learn about the directive and its possibilities.
How to use it
Include angular-simple-logger before Angular-Leaflet js files. Logger gets installed as a requirement of Angular-Leaflet with
bower install or
npm install. Note if your using the browser to load it without CommonJS (browserify, webpack) please use angular-simple-logger.js (not index.js) .
ui-leaflet dependency on your Angular module:
var app = angular.module('demoapp', ['nemLogging','ui-leaflet']);
After that, you can change the default values of the directive on your angular controller. For example, you can change the tiles source, the maxzoom on the Leaflet map or the polyline path properties.
If you want to set the start of the map to a precise position, you can define the "center" property of the scope (lat, lng, zoom). It will be updated interacting on the scope and on the leaflet map in two-way binding. Example:
If you need to run any method on the map object, use
leafletData as following (notice the map object is returned in a form of a promise):
Finally, you must include the markup directive on your HTML page:
If you want to have more than one map on the page and access their respective map objects, add an id attribute to your leaflet directive in HTML:
And then you can use this id in