ipyleaflet
ipyleaflet copied to clipboard
ImageService is jumpy on zoom/pan
The ImageOverlay Layer in ipyleaflet is "jumpy" when zooming or panning around a map. Specifically, when you zoom or pan, the original overlay stays on the screen (in the same pixel position, which is now the wrong geographic position) for a little bit, before the new overlay is fetched from the remote server and displayed. Here is an image of what this looks like, and a screencapture as a video:
This recording was made by running the ImageService.ipynb notebook in the ipyleaflet/examples/ folder here but seems to be a generic feature of the ImageService layer (at least I can replicate this behavior with several different ImageService servers and very simple/straightforward examples).
https://github.com/user-attachments/assets/050ab3b3-6c1f-4d03-9038-72f317f6ebb6
This makes the ImageService layer rather janky and confusing for end users. It would be nicer to either (1) remove the old overlay immediately when panning/zooming or (2) change it so that the old overlay stays displayed in the correct geographic location until the new image comes in from the ImageService. I have been unable to get either of these changes to work in the existing codebase -- any help or suggestions would be great!
Tagging @tsutterley who originally developed this very useful layer!