传单中的下拉过滤器 [英] Dropdown filter in Leaflet

查看:94
本文介绍了传单中的下拉过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Markercluster用于Leaflet,从CSV中提取数据作为标记.很简单.如何添加四个下拉菜单以使用CSV中的字段映射过滤标记?

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/

推荐答案

您尝试过吗?它向Leaflet地图添加了一个下拉列表

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);

这篇关于传单中的下拉过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆