[Solved] Desktop interactive map with Zoom, Drag & boundaries

Hello Protopioneers!

I have been struggling for a few days to create a convincing interactive map prototype with Protopie for DESKTOP.

I have managed to hackily detect the scroll-wheel for zooming in and out (scaling the map image), and managed to give the impression of zooming with the mouse cursor as the origin with a Move calculation (as scaling always scales by the frame’s origin, rather than position of mouse).

I have also created a map boundry box by detecting when the user Zooms out and bouncing the map accordingly (think zooming out from one corner on an image in an image viewer).

However, there are severe issues I can not find a work-a-round for:

When you Scale the map image, it’s Drag limits are not respected. So if you zoom out (Scale -%), the “Limit to screen” setting (or any of the limit settings for that matter) allows you to drag past the borders of the map image. Conversely, if you Zoom In, you can no longer Drag to the boundaries of the image, as the Drag limit “zone” is now too small relative to the scaled image.

Tracking X and Y values for the map and detecting when they fall out of the scaled range does not work, as the Move trigger does nothing while the mouse is held down on Drag. Is this a bug?

Has anyone created a convincing interactive desktop map with boundaries before? I can find no examples of one anywhere online.

Do let me know if you have any ideas.

Many thanks!