L.Polygon getting distorted when panning a map

المشرف العام

Administrator
طاقم الإدارة
I am using Mapbox with leaflet. I have drawn a simple polygon with a hole inside that polygon. I have done this using L.polygon and passing an array of points inside it and another array in reverse direction creating a hole as mentioned in the API docs of leaflet here. the output is as shown in the image below


When we pan the map, I don't want that circle to move from it's place on the screen and hence, on panning of map i am redrawing the circle on the center of the map. But the problem is, when i pan the map, the circle gets distorted. I know, map tiles needs time to load but the circle is also getting loaded and hence not giving clear view, as shown in the images

at start of the panning



and when i keep on dragging



Then once i finish dragging, the circle is normal again (i.e the overlap of map tiles over the circle goes away). This is giving very bad experience to the usernote: I am showing the hole as kilometers within reach, considering the user is at the centre of the circle



أكثر...
 
أعلى