Leaflet Select

Leaflet Select is an easy-to-configure transparent dropdown plugin for leaflet.


Requirements:


Installation:

via npm:

npm install leaflet-select --save

old fashioned way:

download the repository and add the files inside src folder to your project.

Use:

var select = L.control.select({
                   label: 'Select',
                   data : [{title: String, ...}],
                   selected : function(item) {
                       @required
                       //callback when item is selected  
                   },
                   opened: function() {
                       @optional
                       //callback when dropdown opens
                   },
                   closed: function() {
                       @optional
                       //callback when dropdown closes
                   }
               });

select.addTo(map);