How can I increase the size of all markers when we zoom in the map?
I know we can use map.on('zoomend', function() {});
and change the icon size inside the function.But I have a lot of markers and looping through all of them and changing them individually doesn't seem like a good idea.
相关问题
- Leaflet popups for specific base maps
- leafletjs adding scrollable pop up?
- Add text inside leaflet rectangle
- Fit map to bounds exactly
- Popup on hovering over cluster group
相关文章
- change leaflet marker icon
- Prevent zooming out in leaflet R-Map?
- Message from debugger: Terminated due to memory is
- Multiple markers on the exact same position on a L
- leaflet how to make dynamic picture popup using js
- Fill polygon with pattern doesn't work with le
- Leaflet: how to swap coordinates received from an
- Add polygon to map R leaflet
There is nothing wrong with looping through a set of markers on every
zoomend
event. Why doesn't it sound like a good idea?An alternative to looping through markers is to extend the
L.Marker
class to do the work for you, something like:In this case, the Leaflet code will implicitly loop through all the event listeners for the
zoomend
event, which is pretty much the same (performance-wise) as looping through the markers yourself.