I'd like to use, say, a circle or map pin when zoomed out, and for this to change to a polygon / shapefile when zoomed in (specifying the zoom level at which the change occurs).
Can Leaflet do this?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityThis should get you started, might need some adaption to your usecase:
map.on('zoomend', function() { //triggers after zoom event
if (map.getZoom() <x){ //where x is the zoom level where the change occurs
map.removeLayer(yourPolygon);
}
else {
map.addLayer(yourMarker);
}
}
);