Furattopanorama o tsukatta mappu no settei 18 / 5,000 Setting up a map with a flat panorama

  • Hi,

    I want to create a map with a flat panorama.

    Here is the prototype.

    krpano - VR11

    I've set a flat panorama with the following code:

    Code
    		 <layer name="map" type="krpano" width="300" height="300" 
    		 	align="righttop"  x="10" y="10" keep="true"
    		 	onloaded="krpano.actions.loadpano('j_map/map.xml');"	alpha="1" 
    			renderer="webgl"  capture="true"  enabled="true" zorder="5"/> 			

    Problem 1 The scene doesn't change when I click on a spot.

    Problem 2 I can't specify the radar's parent as a spot.

    Problem 3 bgcolor="0x555555" is not reflected.


    Is there a good way to solve this?

    thank you.

  • Hi,

    I think you should communicate etc with the krpano type layer.. all with js.
    In the map.xml, define the global krpano in a js type action and call it for example krpano1.

    Code
    var krpano1 = document.getElementById('krpanoSWFObject');
    krpano1 = krpano1.get('global');
    krpano1.trace(1,'hello world');

    You can also give the krpano layer a bgcolor in the layer definition.
    I would guess that you also can parent the radar to a hotspot in the map.xml with a smart action.

    Tuur*thumbsup*

  • you need to be careful with in which krpano your elements are and where your code is executed...

    one way to have the globals would probably be :

    <layer ... type="krpano" onloaded="copy(krmap,krpano);copy(krpano.krmain,global); ... " />

    now you should be able to access

    - krpano-main from krpano-map with krmain.trace('hello'); and

    - krpano-map from krpano-main with krmap.trace('hello');

    then, if your map hotspots are in krpano-map you would use onclick="krmain.actions.loadscene(...)"

    *blink*

    ps. your radar is in krpano-main but should probably be in krpano-map with parent=""

    and you must have an onviewchange event to set its direction/angle from krpano-main... *pinch*

  • Hi,

    this code seems to tackle most of the issues.


    Here the online version
    https://www.virtualtuur.com/krpano/122/bar…ples/pic_map/1/index.html

    https://www.virtualtuur.com/krpano/122/barebones/examples/pic_map/1/tour.xml

    edit: made small change (put the doradar action in the prepmap action) and the fov on the cone + heading
    Hope it helps

    Tuur*thumbsup*

  • This is the code from my example

    tour.xml

    map.xml

    I just realized that the following customhlookat customhfov attributes appeared on the radar *thumbsup*

  • Hi San7 thanks for your example.

    I have been able to achieve what I wanted except loading the map with "startup view".

    I thought it was just setting hlookat, vlookat and fov in map.xml but it ignores this and always loads the full size map, not the part I need.

    I have reviewed the code without finding the error.

    -----

    Tuur thanks for your example. I'm looking into it too.

    I think the idea of loading a map via a krpano layer is the best for large plans and maps and we should have an example included in the krpano distribution like yours.

  • Hi
    If you have connected flatpano_setup.xml , then the view settings are set in it!

    I thought about it a bit and changed the code. When you start the tour, the plan increases example.

    This is the code:

    tour.xml

    map.xml

  • Hi San7 !!

    The example you kindly shared allows to use a Krpano-type layer as a unique map that can be linked to multiple scenes belonging to that map.

    However, if there are multiple maps for other scenes, I'm having a hard time adapting that same example. *confused*

    Could you share something like scene1 and 2 -> map A and scene 2 and 3 -> map B, where map A and B are Krpano-type layers used as maps?

    Thank very much *smile*

    Edited once, last by Fernando (April 28, 2025 at 12:57 AM).

  • Hi San7 !!

    The example you kindly shared allows to use a Krpano-type layer as a unique map that can be linked to multiple scenes belonging to that map.

    However, if there are multiple maps for other scenes, I'm having a hard time adapting that same example. *confused*

    Could you share something like scene1 and 2 -> map A and scene 2 and 3 -> map B, where map A and B are Krpano-type layers used as maps?

    Thank very much *smile*

    Hi, I tested it and here's what I did - test

    For each plan, folders are created and in them lies a flat panel with points and map.xml

    map.xml

    all_map.xml - one code for all maps

    all_map.xml

    tour.xml

Participate now!

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