Markers cut off when using zoomToBoundsOnClick
See original GitHub issueIn the second image, you can see that after the zoom, the markers are partially outside the bounds. Is this an issue with the zoomToBoundsOnClick
function not calculating the size of the markers, or something that I’m doing wrong? It does include the exact lat/lng point of the marker, but it seems like it should account for the markers so that you can actually click on them after the zoom.
Issue Analytics
- State:
- Created 10 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Limit Zoom level when markers are on the same position
I would like to limit the zoom level when user click on one cluster with a code like this : markers.on('clusterclick', function (a)...
Read more >Showing popup with info about all markers in the clustered ...
To display popup upon marker cluster click with info about all the markers in the cluster, there are several things needed:.
Read more >Leaflet.markercluster | Marker Clustering plugin for Leaflet
showCoverageOnHover: When you mouse over a cluster it shows the bounds of its markers. zoomToBoundsOnClick: When you click a cluster we zoom to...
Read more >Leaflet Marker Cluster Group - JSFiddle - Code Playground
var markers = L.markerClusterGroup({. 5. spiderfyOnMaxZoom: true, ... zoomToBoundsOnClick: true ... Use jQuery to load date from GeoJSON file.
Read more >https://raw.githubusercontent.com/rstudio/leaflet/...
Evaluate list members that are formulae, using the map data as the ... it shows the bounds #' of its markers #' @param...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In case it’s of use to others, I ended up setting zoomToBoundsOnClick to false and doing something like this to get finer control over the zoom…
markers.on(‘clusterclick’, function (a) { var bounds = a.layer.getBounds().pad(0.5); map.fitBounds(bounds); });
In my case @arnoldbird 's code was sometimes not zooming at all on small screens so I’ve added zooming in indefinitely if it failed to zoom in on cluster click: