1

I am using this example to setup a control layer.

http://leafletjs.com/examples/layers-control.html

L.control.layers(baseMaps, overlayMaps).addTo(map);

How do I just update overlayMaps with latest markers? In other words, the user may or may-not have the overlayMaps "checked" and I just want to update the markers based on latest data.

1 Answer 1

2

Use L.Control.Layers.addOverlay() and L.Control.Layers.removeLayer().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.