我对Leaflet JavaScript完全陌生。基本上我需要编写一些东西:
Anya的想法或例子怎么做?或者在哪里找到它们?
由于
答案 0 :(得分:2)
map.on('click', onMapClick);
function onMapClick(e) {
alert("You clicked the map at " + e.latlng);
}
3.根据坐标绘制框:
var bounds = [[X, Y], [X, Y]];
// create an orange rectangle
var boundingBox = L.rectangle(bounds, {color: "#ff7800", weight: 1});
map.addLayer(boundingBox);
4。清除方框:
map.removeLayer(boundingBox的);