我想在OpenStreetMap上的可见标记上显示一个列表,但是我不知道该怎么做。
使用Javascript,我从数据库中获得了一个标记列表,并将其显示在Map(带有集群)上。
wtfmap = new L.Map('map',{ zoomControl: false });
new L.Control.Zoom({ position: 'topright' }).addTo(wtfmap);
// create the tile layer with correct attribution
//var osmUrl = 'https://www.mapquestapi.com/sdk/leaflet/v2.s/mq-map.js?key=2ul2Jx78yAXfnwlBIdY3Fn5VP94quLOz';
var osmUrl = '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib = 'Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
var osm = new L.TileLayer(osmUrl, {
minZoom: minimumZoom,
maxZoom: maximumZoom,
attribution: osmAttrib
});
// start the map in region or in center of France
latlng = new L.LatLng(lat, lng);
wtfmap.setView(latlng, zoom);
// add the map
wtfmap.addLayer(osm);
// On crée une classe pour les nouveaux marqueurs
var wtfMarker = L.Icon.extend({
options: {
iconSize: [37, 62],
iconAnchor: [10, 30], // The coordinates of the "tip" of the icon (relative to its top left corner).
popupAnchor: [3, -29] // The coordinates of the point from which popups will "open", relative to the icon anchor.
}
});
如何从地图中获取事件(放大/缩小/向左移动,向右...)以及地图上可见标记的更新列表?