Dropdown filter in Leaflet

2019-08-29 06:11发布

I am using Markercluster for Leaflet, pulling data from CSV as markers. Simple enough. How can I add four dropdown menus to map that filter markers using fields in the CSV?

http://erichsen-group.com/demoland/datademo/projects/

1条回答
混吃等死
2楼-- · 2019-08-29 06:18

Have you tried this? It adds a single dropdown to Leaflet map

var legend = L.control({position: 'topright'});
legend.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend');
div.innerHTML = '<select><option>1</option><option>2</option><option>3</option></select>';
div.firstChild.onmousedown = div.firstChild.ondblclick = L.DomEvent.stopPropagation;
return div;
};
legend.addTo(map);
查看更多
登录 后发表回答