Mainloadpano question.

  • Hey guys.

    Lately I wrote a code for my virtual tour to stop the autorotation when someone moves a mouse over the hotspot.
    Had a bit of little problems there but I made a walkaround codes. Its huge because of huge amount of hotspots in the tour.

    I would like to ask you if there is an easier way to get the maindloadpano(virtualtourXX) part, instead of going throu each xml file and checking it.

    Here is the code:

    Code
    set(hotspot[spot27].onclick,set(autorotate.enabled,true);looktohotspot(get(name),get(view.fovmin),smooth(400,20,100));mainloadpano(virtualtour11.xml);lookat(get(hview),get(vview),get(fovview));wait(blend);lookto(get(panoview.h),get(panoview.v),get(panoview.fov),smooth(100,20,50)));

    I was wondering if there could be something done with "get".

    Thanks in advance.

  • Without the rest of the code it's hard to say. I also didn't get your issue exactly.
    What I can propose to you is to use style to define what you want with less coding.

    E.g. On Hotspot define new attribute which will contain information what xml is to be loaded when clicked on hotspot. Than in style you can have something like this:

    Code
    <hotspot name="your_hotspot_1" style="your_style" ath="5" atv="4" xml_to_load="virtualtour11" />
    <style name="your_style" visible="true" keep="false" url="your_png_file.png"   onout="set(autorotate.enabled,false);" 	onover="set(autorotate.enabled,false);"	onclick="txtadd(load_xml,'%FIRSTXML%/get(xml_to_load),'.xml');loadpano(get(load_xml), null, MERGE, BLEND(3));"	/>

    Did you get the point? Can this help you with the rest?

  • Dont rly understand the code on the 1st look at it :)

    I'll study it a bit.

    My point is to:

    -When autorotation is turned on : stop autorotating when mousce cursor get over the hotspot and start it again when it get out of the hotspot.

    -When the autorotation is turned off: do nothing :)

    And ofc it has to remember that the autorotation was turned on/off when changing the pano via mainloadpano.

    Dunno if you get my point now :D

  • As you didn't share any code or link I will try to explain:
    - Most probably you have button that turn autorotation on/off. There you have to set some variable e.g. autorotation_turned_on to true. Just to keep the state of autorotation.
    So, find the code where you are turning autorotation on and add the following:

    Code
    set(autorotation_turned_on, true);


    Where you turning it off put:

    Code
    set(autorotation_turned_on, false);


    In your hotspot definition add:

    Code
    onover="if(autorotation_turned_on,set(autorotate.enabled,false));"onout="if(autorotation_turned_on,set(autorotate.enabled,true));"


    Justs tested and it is working fine.

Jetzt mitmachen!

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