Hotspot Delete on moveable Icon-Click?

  • Hello,

    maybe you can give me a helping hand on how to best implement the following functionality.
    I have a small krpano web app where visitors can dynamically set hotspots by clicking on a gigapixel panorama.
    This hostspot is then draggable so that it can be positioned even more precisely. So far so good - everything works fine.
    Now I would like to add another functionality to the hotspot - namely a small "Delete" symbol in the upper corner (see screenshot of the icon) - as soon as this is clicked, I would like to delete the hotspot.

    HS Drag/Drop on "Main Icon", HS Delete on "Sub Icon" ...


    Unfortunately, at the moment it is just not clear to me how I should get these two functions (move & delete) onto the hotspot - even if they are different regions of the icon ...?!

    Hopefully one of you here can give me the right idea! *smile*

    Thank you, best regards from Tyrol
    Andreas

  • @indexofrefraction - thx for this Info. But I'm creating the Hotspots dynamically. Not quite sure how to nest them then?

    Code
    addhotspot(get(hs));
    set(hotspot[get(hs)].url, calc(viewerDom+viewerPath+'includes/krpano/1.20.9/skin/GPix_Marker.png'));
    ...

    But I'm just near a solution with Layers and the Hotspot as Parent ... Guess this should work *wink*

    Code
    calc(del_layer_name,'layer_' + hotspot[get(hs)].name);
    addlayer(get(del_layer_name));
    set(layer[get(del_layer_name)].type, "image");
    set(layer[get(del_layer_name)].parent, calc("hotspot["+get(hs)+"]"));
    set(layer[get(del_layer_name)].onclick, trace("del layer click"););
  • thx for your input ... seems like it's working as it should now ... bit hard to do if one only works with krpano every few years ... *wink*
    Solution:

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!