I am working on map control app using leaflet plugin ....
I added a custom button for marker in side toolbar....
Target
I want to put marker on map when i click on that button....in other words i want to enable marker control when i click on this button
Problem
I am trying to bind the marker events with that button and as usual i face failure in doing that,,,,(please consider i am using the poly area functions but want to keep markers separate)
In script :
var greenIcon = L.icon({ iconUrl: 'assets/img/marker-icon.png', shadowUrl: 'assets/img/marker-shadow.png', }); map.on('click', putMarker); function putMarker(e) { L.marker(e.latlng, { icon: greenIcon }).addTo(map); } //custom button for marker L.easyButton('glyphicon-facetime-video', function () { }).addTo(map);
أكثر...
I added a custom button for marker in side toolbar....
Target
I want to put marker on map when i click on that button....in other words i want to enable marker control when i click on this button
Problem
I am trying to bind the marker events with that button and as usual i face failure in doing that,,,,(please consider i am using the poly area functions but want to keep markers separate)
In script :
var greenIcon = L.icon({ iconUrl: 'assets/img/marker-icon.png', shadowUrl: 'assets/img/marker-shadow.png', }); map.on('click', putMarker); function putMarker(e) { L.marker(e.latlng, { icon: greenIcon }).addTo(map); } //custom button for marker L.easyButton('glyphicon-facetime-video', function () { }).addTo(map);
I dont have idea or knowledge and can't find any help regarding.... please if somone help,, any kind of help or reference will be appreciated... Thanks for your time
أكثر...