Working with leaflet api where i have added a custom marker control...
There also we can add multiple baseLayer and toggle between these layers....
Lately i was trying to bind the markers with this base layer and i can't understand the documentaion very well so having difficulty if someone help.....
Script
//Custom control for marker L.easyButton('fa-arrow', function () { map.on('click', function arrow(e) { L.marker(e.latlng, { icon: arrIcon, draggable: true}).addTo(map); map.off('click', arrow); }); }).addTo(map); //already added layer and needs to bind marker with this var layerGroup = new L.LayerGroup(), imageOverlayUrl = 'abc.jpg', imageOverlay = new L.ImageOverlay(imageOverlayUrl, bounds).addTo(layerGroup), featureGroup = new L.FeatureGroup().addTo(layerGroup); var layerGroupings = { "Main": layerGroup }; var layerControl = new L.control.layers(layerGroupings,null, { collapsed: false }).addTo(map); In short, i have a need to bind my custom marker with this layer i have defined in script, if there is a way please guide or give reference..thanks for your time
أكثر...
There also we can add multiple baseLayer and toggle between these layers....
Lately i was trying to bind the markers with this base layer and i can't understand the documentaion very well so having difficulty if someone help.....
Script
//Custom control for marker L.easyButton('fa-arrow', function () { map.on('click', function arrow(e) { L.marker(e.latlng, { icon: arrIcon, draggable: true}).addTo(map); map.off('click', arrow); }); }).addTo(map); //already added layer and needs to bind marker with this var layerGroup = new L.LayerGroup(), imageOverlayUrl = 'abc.jpg', imageOverlay = new L.ImageOverlay(imageOverlayUrl, bounds).addTo(layerGroup), featureGroup = new L.FeatureGroup().addTo(layerGroup); var layerGroupings = { "Main": layerGroup }; var layerControl = new L.control.layers(layerGroupings,null, { collapsed: false }).addTo(map); In short, i have a need to bind my custom marker with this layer i have defined in script, if there is a way please guide or give reference..thanks for your time
أكثر...