Force update of hotspots

  • Hello,

    I'm building a webtool to create virtual tours, powered by KRPano, and NextJS for the front. To simplify the usage of krpano, i'm using react-krpano library.
    But i'm facing some issues when I dynamicly change some informations on the hotspot, like the style props.
    For exemple, i got a hotspot with the style "style1|style2", if i change it from react to "style1", it will update the hotspot style in krpano attributes (if i try to get it from js console), but it will not update really remove the styles informations. I guess it's because when i change the style from react, it does not call the "loadstyle" function to update styles.

    So wanted to know if is there any way from krpano to force update of a specific hotspot / all hotspots ? My current workaround is to store a prefix variable on my hotspots, and update the prefix when i need to force update it (it will delete the current hotspots, and re-create a new one with the new prefix)

    Thanks.

    A front-end web developer, specialized in Virtual Tours and ReactJS

  • styles are applied when the xml gets parsed
    and a later change of the style attribute does not trigger attribute changes.
    also a loadstyle call would just mess things up, because it does not undo any previously applied styles

    recreating is probably the best, maybe only solution

    if it is about identical attributes you can have a look at copyattributes
    https://krpano.com/docu/actions/#copyattributes

Jetzt mitmachen!

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