Selecting different floorplans (as layers) by using combobox dropdown

  • Hi there
    I'm guessing this is a bit of a stupid question...but...hey ho...

    I want to from a drop down list make the tour display different floorplans (which are set as layers with navigation layers in them) so really just trying to work out what should replace the "onclick="loadscene(scene_Set01_Panorama);" code to make a layer e.g. "groundfloor" visible and the other layers (floors) in same location (on screen) not visible.

    I'm guessing this is a pretty standard approach?

    Thanks in anticipation
    Peter

  • Hard to say withhout the code but I can try:
    - In your scene you have attribute onstart. There you can place actions you want to be triggered at scene start e.g.

    Code
    <scene name="scene_first" title="first" onstart="set(layer[groundflor_1].visible,true);set(layer[groundflor_2].visible,false);set(layer[groundflor_3].visible,false);" thumburl="panos/first.tiles/thumb.jpg" lat="" lng="" heading="">
    
    
    		<view hlookat="0" vlookat="0" fovtype="MFOV" fov="110" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />
    		<preview url="panos/first.tiles/preview.jpg" />
    		<image type="CUBE" multires="true" tilesize="512" progressive="false">
    			.
    			.
    			.
    		</image>
  • Thanks Umalo
    I understand I have not made my question v.clear...
    this is the typeof thing I am trying to achieve...
    http://www.vpix.net/index.php?tour=102855
    however this involves using the combobox plug in and creating some form of onclick command that says (as in your advice I think) set a particular layer to "visible". So if there are 4 layers (=floors) then one of them could eacjh be selected from the drop down list. I just thought this would be a fairly normal requirement.
    I have been tried loading some additional xml code by ten selected although I guess this is a clumsy way of achieving what I want?
    BUT I DON'T BELIEVE THIS IS THE RIGHT WAY

    e.g.
    <plugin name="floor" url="plugins/combobox.swf" alturl="plugins/combobox.js"
    align="rightbottom" x="1%" y="63%" width="15%" height="4%" visible="true" keep="true" alpha="1" rowcount="10" >
    <item name="ground" caption="Ground" onclick="loadpano(floor.xml, null, MERGE, BLEND(2));" />
    <item name="lower" caption="Lower Ground" onclick="loadpano(lower.xml, null, MERGE, BLEND(2));" />
    <item name="first" caption="First Floor" onclick="loadpano(first.xml, null ,MERGE, BLEND(2));" />
    <item name="second" caption="2nd Floor" onclick="loadpano(second.xml, null, MERGE, BLEND(2));" />
    ...
    </plugin>

    As you will see I don't really understand xml at all... I'm a photographer!!

    Any guidance really appreciated!
    Peter

  • aha now I get it.
    Well if we are talking about the left screen side box than it is not loading any new scene but just tween appropriate layer from "outside"
    In general: those are 4 layers with map and mappoints. all positioned outside and when item from box selected you call action that will hide them all and position them all outside and than tween one of them to right position.
    Can be done in many ways and should be no more than couple of lines of code.
    You see also bug in this tour where what ever floor you select it always show some mappoint as active with radar. You would most probably like to see only radar on the floor where current active scene is beloning?
    Do you already have your layers with maps and mappoints created. If not you have in examples code for simple usage. Online version here:
    https://krpano.com/examples/117/e…h-imagemap.html

  • I see Umalo
    My actual idea was a simple drop down within the visible(normal pano) area but if they could be dragged from outside even better.. so what I would find useful is the link (onclick) code between selecting an item from the list and dispalying one of those images with hotspots (I reckon I can sort those out ok; although I've avoided radar as a bit too complex for me) I'm actually quite happy to find someone I can turn to in this area as I say I ain't no programmer....

  • Do you already have your layers with maps and mappoints created. If not you have in examples code for simple usage.

    Hi Umalo
    With your guidance I have now put it all in one xml file...

    If you take a look at http://www.360vista.net/floor2.php then you will see where I am ...what I believe I need to do is change the x axis for the four floorplans to send them out of screen to right and then have an onclick action that moves the respective one to the right position by changing the value again....but how do I do this?

    The current code for the correct combobox is;
    <plugin name="floor" url="plugins/combobox.swf" alturl="plugins/combobox.js" align="rightbottom" x="1%" y="63%" width="15%" height="4%" visible="true" keep="true" alpha="1" rowcount="10" >
    <item name="ground" caption="Ground" onclick="loadxml();" />
    <item name="lower" caption="Lower Ground" onclick="loadxml();" />
    <item name="first" caption="First Floor" onclick="loadxml();" />
    <item name="second" caption="Second Floor" onclick="loadxml();" />
    ...
    </plugin>


    The layers are like this: with layer name "ground", "lower", "first", "second"...

    <layer name="ground" url="grndfloor.jpg" keep="true" align="rightbottom" x="5%" y="12%" width="15%" height="50%"
    visible="true"
    handcursor="true"
    scalechildren="false"
    maskchildren="true"
    onclick="closemap();"
    zorder="2"
    >

    The idea of tweening is good and would look much nicer and I think I can suss it out if I can get to the next stage?

    Thanks
    Peter

  • Now you have tweening and right floor open depending on what scene is loaded.
    Think about what if you have portrait orientation of the screen? Your percentage based sizing with both attributes width and height in % is not good idea. At least make one % second PROP. Test it to see what I'm talking about. Resize your browser and observe. Same for dropdown lists definition.

Participate now!

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