Reputation: 2586
I am totally new to Leaflet JavaScript. Basically I need to program something that:
Anya ideas or examples how to do this? Or where to find them?
Thanks
Upvotes: 1
Views: 6836
Reputation: 2550
map.on('click', onMapClick);
function onMapClick(e) {
alert("You clicked the map at " + e.latlng);
}
3.Draw the box based on coordinates:
var bounds = [[X, Y], [X, Y]];
// create an orange rectangle
var boundingBox = L.rectangle(bounds, {color: "#ff7800", weight: 1});
map.addLayer(boundingBox);
4. Clear the box:
map.removeLayer(boundingBox);
Upvotes: 3