XML-extension minimap_zoomrect.xml

  • Hello

    Several years ago, I needed a navigator window for two 360° panorama projects, thanks to which the current view is displayed in a small window. With the help of the developer Umalo, I was able to integrate this option and everything worked as desired (see https://panorama.kunstmuseumthun.ch and https://zoom-old.murtenpanorama.ch).

    Now in one of the two projects, a new 360° panorama image (3.5 GB) is to be integrated and I updated krpano to a current version (1.21). Unfortunately, the user-defined ‘plugin’ no longer works. Thanks to the XML extension minimap_zoomrect.xml, I was fortunately able to achieve almost the same functionality (see http://zoom.murtenpanorama.ch).

    In contrast to the old projects with the Umalo-plugin, the red rectangle in the navigator window disappears if I move the 360° panorama more than 180° to the left or right. Ideally, it should reappear at the opposite end of the navigator window. I assume that this adjustment is fairly easy to implement, but it is beyond my skills and knowledge of XML programming in krpano.

    Many thanks for your help and support.

  • You can either use the 1.22 - there this fix is already implemented. Or use clamp() as Klaus suggested in another thread with the same question *wink*

    You could limit the position of the rectangle already during dragging by adding this code to the minimap_zoomrect_dragging action (directly after calculating the caller.x/caller.y position):

    Code
    clamp(caller.x, 0, (parentlayer.pixelwidth - caller.pixelwidth));
    clamp(caller.y, 0, (parentlayer.pixelheight - caller.pixelheight));


    EDIT: Just realized that you have to deal with 360° images. Those fixe might actually not cover that.

    Edited once, last by s-maier (January 16, 2025 at 8:28 PM).

  • I did a test.

    in the file minimap_zoomrect.xml replace the action minimap_zoomrect_onviewchanged with this:

  • Thank you very much for your quick help. I really appreciate your support.
    The code from San7 works perfectly and I installed it this morning.

    One additional question:
    For better visibility I would like to change the background-color of the red rectangle with a transparent white resp. rgba(255, 255, 255, 0.5). I've tried but I failed. You probably know where to ‘tweak’ the code.

    Best Regards

  • Hi, in this action, add what I highlighted.

    <action name="minimap_zoomrect_init" scope="local">

    ...

    set(zoomrect,
    parent=get(caller.name),
    keep=get(caller.keep),
    type='container',
    bgborder=calc(caller.zoomrect_border ? caller.zoomrect_border : '1 0x0000FF 1.0'),
    bgcapture=true,
              bgcolor='0xffffff',
    bgalpha=0.5,
    ondown='minimap_zoomrect_dragging();'
    );


    ...


    <layer name="minimap" ...
    zoomrect_border="1 0xff0000"
    ...
    />

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!