I am using this example to setup a control layer.


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.


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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