Posts about Leaflet

Distinguish Between Manual and Programmatic Map Movement in Leaflet

June 26th 2016 Leaflet AngularJS

Leaflet map state can be manipulated in two ways: manually using mouse to pan and zoom or programmatically with a set of methods for this specific purpose. In some cases it can be useful to know which of these two approaches was used for manipulating the map. Unfortunately Leaflet doesn't have a built-in way to distinguish between the two map manipulation modes, but with a good enough understanding of the JavaScript runtime this can still be achieved.

Handling Events with Angular Leaflet Directive

February 8th 2016 Leaflet AngularJS

Leaflet JavaScript library includes comprehensive support for events, raised by the map itself or by one of many objects rendered on the map. Detailed documentation covers all aspects of working with events: management of individual event listeners, structure of arguments passed to listener functions, and a list of supported events for the map and for each individual object type. Angular Leaflet directive broadcasts all these events as standard JS events, but the documentation is much more scarce.

Bringing a Marker to Front in Leaflet

January 23rd 2016 Leaflet AngularJS

Leaflet is an open-source JavaScript library for interactive maps. It's very feature rich, but its sometimes hard to find resources on approaches that deviate from the most common ones. When handling many markers in a small region, clustering is the go-to solution, but certain scenarios can require every markers to be rendered all the time. Leaflet has features to keep individual markers easily accessible nevertheless.