Locate region on an image map with hotspot

Hello,
I tried using a hotspot to move my image map, but I couldn’t get it done.
At first, I reference the hotspot with a variables LVAR1.x and LVAR1.y, still it didn’t work.

Here is a link;
https://3eszf3.axshare.com
or
https://3eszf3.axshare.com/#id=k3195e&p=page_1

And here is the test project:
map locator test.rp (119.6 KB)

Your setup is good, just need to adjust your “positioning logic”.

Using a hotspot to define a region is fine, and makes it easy and straightforward to use its location. If you want that hotspot region to move to the upper left of the map area, just move the “inner image” dynamic panel to the hotspot’s “negative coordinates” --similar to how you’ve done in the blue button where you have “Move Image map by (-200, -100)” to get the larger map to move relatively 200 px to the left and 100 px up. The only difference is you should move the whole “inner dynamic panel” rather than the image (within that dynamic panel) itself. If you do the latter then the relationship (position) of the map image to the hotspot will be lost. In other words, moving the “inner image” dynamic panel moves the hotspot and the map together–which is what you want.

So, moving the map to place the “spot” region at upper-left would look like:
Move inner image to ([[-LVAR1.x]], [[-LVAR1.y]])

Here is an updated file showing this, along with an algorithm to center your map region within the Map outer dynamic panel.
map locator test.rp (136.2 KB)

  • Note the bottom 3 buttons work until you click the top blue button–which moves the image widget separately from the hotspot widgets, thus breaking their positional relationship.
1 Like

Thank you very much for the explanation and corrected version of the project.