Close Floor Plan Map

  • I'm trying to find a way to open and close a floor plan map by clicking on a separate icon instead of having it simply reduce in size; I want it to disappear all together. I have a map icon in the bottom right of my viewer (currently linking to my website) that I want to have control the floor plan map; click it: open map, click it again: close map. Does anyone know how I would do this with xml?

    My demo
    http://www.gsjackson.com/demo/demo.html

    Thanks

  • I think this should do it. I also kept the map click-able to close it out.


    Find and replace this

    <!--************** Logos **********************************************************************-->
    <plugin name="mapicon1" url="demodata/graphics/mapicon.png" keep="true" align="rightbottom" x="10" y="10" width="125" height="76" onhover="showtext('Created by: Gary S. Jackson');" onclick="openurl(http://www.gsjackson.com,_blank)"/>

    with this


    <!--************** Logos **********************************************************************-->
    <plugin name="mapicon1" url="demodata/graphics/mapicon.png"
    keep="true" align="rightbottom" x="10" y="10" width="125"
    height="76" onhover="showtext('Close Map');"
    onclick="closemap();"/>


    Find and replace this





    <!-- close the map -->
    <action name="closemap">
    set(plugin[mapradar].visible,false);
    hidemapspot();
    set(plugin[map].onclick,openmap);
    tween(plugin[map].width,100);
    tween(plugin[map].height,100);
    </action>
    <!-- open the map -->
    <action name="openmap">
    if(plugin[mapradar].shouldbevisible == true, set(plugin[mapradar].visible,true););
    set(plugin[map].onclick,closemap);
    tween(plugin[map].height, 300, 0.5, easeoutquad);
    tween(plugin[map].width, 300, 0.5, easeoutquad, showmapspot(););
    set(plugin[map].align, lefttop);
    set(plugin[map].x, 10);
    set(plugin[map].y, 116);
    </action>


    with this

    <!-- close the map -->
    <action name="closemap">
    set(plugin[mapradar].visible,false);
    hidemapspot();
    tween(plugin[map].width,100);
    tween(plugin[map].height,100);
    wait();
    tween(plugin[map].alpha,0);
    set(plugin[map].enabled,false);
    set(plugin[mapicon1].onclick,openmap());
    set(plugin[mapicon1].onhover,showtext('Open Map'));

    </action>
    <!-- open the map -->
    <action name="openmap">
    if(plugin[mapradar].shouldbevisible == true, set(plugin[mapradar].visible,true););
    set(plugin[mapicon1].onclick,closemap);
    set(plugin[mapicon1].onhover,showtext('Close Map'));
    tween(plugin[map].alpha,1);
    set(plugin[map].enabled,true);
    wait();
    tween(plugin[map].height, 300, 0.5, easeoutquad);
    tween(plugin[map].width, 300, 0.5, easeoutquad,, showmapspot(););
    set(plugin[map].align, lefttop);
    set(plugin[map].x, 10);
    set(plugin[map].y, 116);
    </action>



    -------------------------------------------------------------------------------------------------------------------------
    Replace this


    <!--************** Plugin map *****************************************************************-->
    <plugin name="map" url="demodata/map/map.png" keep="true" align="topleft" x="10" y="116" width="300" height="300" handcursor="false" onloaded="showmapspot();" onclick="closemap"/>


    with



    <!--************** Plugin map *****************************************************************-->
    <plugin name="map" url="demodata/map/map.png" keep="true" align="topleft" x="10" y="116" width="300" height="300" handcursor="false" onloaded="showmapspot();" onclick="closemap();"/>


    I gotta say, it looks like Kolor's product is getting better if you can do a decent basic tour without any handcoding.

    Jarred

    Edited once, last by Jarredja (September 21, 2011 at 12:06 AM).

  • Jarred,

    That's exactly what I was looking for but there's only one problem: I made all of the changes and the map opens/closes perfectly, however if I close the map and then reopen it, all of the radar spots (view points) disappear. They are there when I initially load the tour and they remain there as long as I don't close the map. Once I reopen it though, they're gone.

    I really appreciate your help with this.

    Thanks

  • I think I accidently added a comma here

    tween(plugin[map].width, 300, 0.5, easeoutquad,, showmapspot(););
    set(plugin[map].align, lefttop);
    set(plugin[map].x, 10);
    set(plugin[map].y, 116);
    </action>

    try this instead. However, on my test site, which was built with your code minus some plugins, it works for me locally. I will try to upload and test but try removing the , or replacing the code posted.

    tween(plugin[map].width, 300, 0.5, easeoutquad, showmapspot(););
    set(plugin[map].align, lefttop);
    set(plugin[map].x, 10);
    set(plugin[map].y, 116);
    </action>

  • I have another related issue:

    Everything works great with the open/close map function with one button. How would I switch the "close map" icon with a "open map" icon after the map closes? Right now the hover state changes, but I'd like to change the button itself. I got this to work with a slideshow gallery I added but can't get it to work with the map function...see example: http://www.gsjackson.com/appleton/demo.html

    Here's the code I'm currently using that Jarred helped me with:

    Thanks

Participate now!

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