Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Freitag, 1. Juni 2018, 17:07

How to unload dynamicaly loaded <style> in Krpano?

Hi there,

How can I unload <style> added to <hotspot> dynamically?

When I assign style to hotspot I use

Quellcode

1
hotspot.loadstyle( @style_name@);
method, but how can I remove/unload this style without deleting or replacing hotspot itself?

Thanks, looking forwad to get reply from you.
Regards,
Maksim

2

Freitag, 1. Juni 2018, 17:38

when a style is applied to an element (i.e. hotspot)
all its attributes are copied to the target, except for attributes already set on the target.
there is no unloadstyle() because it is impossible to know what was set on the original hotspot after this procedure.

but to go back to the original state you could maybe backup and restore your hotspot
something like...

copy(hotspot[example_bak], hotspot[example]);
set(hotspot[example_bak], visible, false);
hotspot[example].loadstyle(style_name);
...
copy(hotspot[example], hotspot[example_bak]);
set(hotspot[example], visible, true);
delete(hotspot[example_bak]);


... completely untested *rolleyes*

3

Mittwoch, 20. Juni 2018, 13:39

when a style is applied to an element (i.e. hotspot)
all its attributes are copied to the target, except for attributes already set on the target.
there is no unloadstyle() because it is impossible to know what was set on the original hotspot after this procedure.

but to go back to the original state you could maybe backup and restore your hotspot
something like...

copy(hotspot[example_bak], hotspot[example]);
set(hotspot[example_bak], visible, false);
hotspot[example].loadstyle(style_name);
...
copy(hotspot[example], hotspot[example_bak]);
set(hotspot[example], visible, true);
delete(hotspot[example_bak]);


... completely untested *rolleyes*
Thanks for your suggestion, I did it a little bit different but algorithm is closed to yours. But unfortunetely, when I remove previous hotspot and replace it with new one it blinks for a couple of mileseconds. Do you have any ideas, how can I get rid of this side effect, I mean the blink itself?
Regards,
Maksim