Leaflet polygons cut off on map viewport while dragging
See original GitHub issueCurrent behavior: When dragging the map so that polygons or circles are only partly in the viewport, then dragging back to reveal them again, the part of the polygons or circles that were out of the viewport are cut off only to be properly redrawn after dragend.
Desired behavior: Either the polygons and circles should not be cut off, or seamlessly redrawn/reappear in the viewport.
The problem is present in http://leafletjs.com/examples/quick-start.html, see the attached gif for an impression of what happens.
Browser: Chrome 36.0.1985.125 m OS: Windows 8.1 Pro
Only part of the issue is present in IE 11.0.9600.17207. Leaflet does work as desired for circles only in this version of IE.

Issue Analytics
- State:
- Created 9 years ago
- Reactions:3
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Leaflet polygons cut off on map viewport while dragging
Desired behavior: When dragging the polygon or circle it should come center of the map and it should load properly(Don't cut off). The...
Read more >How to keep leaflet tooltips within visible map view
The issue is when the user mouses over features on the outer edges of the visible map area, the tooltips are outside of...
Read more >Plugins - Leaflet - a JavaScript library for interactive maps
Displays national maps of Switzerland using map tiles from Swisstopo. ... that is kept fixed to the center of the map when the...
Read more >Chapter 6 Leaflet | Introduction to Web Mapping
Open example-06-01.html in the browser. Try changing map perspective by dragging the mouse while pressing the Ctrl key. Compare this type of interaction...
Read more >geoman-leaflet-extend - npm Package Health Analysis - Snyk
The npm package geoman-leaflet-extend receives a total of 0 downloads a week. ... make polygon not snappable during draw map.pm.
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 Free
Top 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

Apparently the
L.Mapconstructor accepts arendereroption, so you can do something like this:Of course you wouldn’t want to do this with a map that has a lot of things to render. But for my use case, this worked really well!
Side note: The current version of Leaflet (1.0.1) will actually (from what I can tell) create the renderer the first time
map.getRenderer()is called, which you can see here https://git.io/vPn2v. So you could also do this:NOTE: I know this issue has been closed for a while now, but I was having this issue today, and figured I’d share my solution, in case anyone else comes across the same issue!
Brief update in case anyone else from the d3-verse ends up on this thread… at this point I believe the problem was that I was not manually fitting the d3 svg to the leaflet pane using getBounds, which is demo’d here: http://bl.ocks.org/d3noob/9211665.