Hi! My level of knowledge is to take a code snippet from the example and paste it into my tour. Basically everything works out, but I can't solve one problem or even find a way to look for it):
In all the examples, I see coordinates (ath, atv) for points of hotspots or layers that work in the panorama space (yes, I can make a flat panorama and use it all). But would I like to use a polygonal hotspot on the image of a map or layer? Is this possible, how will the x/y coordinates for the polygon points be specified relative to the substrate layer (map)?
Thanks!
Polygonal hotspot (layer) on a flat image map (layer)
-
-
Take a look at https://krpano.com/releases/1.23/…otour-apartment
In the xml, polygon hotspots have been defined:
Code<hotspot name="er_to_lr" style="roomspot" tooltip="get:scene[lr].title" onclick="scene3dtransition(lr);"> <point ath="-31.167381" atv="-26.721998" /> <point ath="1.439101" atv="-30.402683" /> <point ath="1.877027" atv="43.226524" /> <point ath="-31.571499" atv="37.882914" /> </hotspot>ath/atv behave the same as ath/atv for normal hotspots...
-
This is because a flat panorama is just a really small picture inside the space of a spherical panorama.
You can either just figure out and use ath/atv or calculate it from pixel x/y.
I for example use thousands of perfectly pixel aligned hotspots on a flat panorama which get automatically calculated from the corresponding pixel coordinates.
-
Take a look at https://krpano.com/releases/1.23/…otour-apartment
In the xml, polygon hotspots have been defined:
Code<hotspot name="er_to_lr" style="roomspot" tooltip="get:scene[lr].title" onclick="scene3dtransition(lr);"> <point ath="-31.167381" atv="-26.721998" /> <point ath="1.439101" atv="-30.402683" /> <point ath="1.877027" atv="43.226524" /> <point ath="-31.571499" atv="37.882914" /> </hotspot>ath/atv behave the same as ath/atv for normal hotspots...
Thanks, I'm trying this option, but it doesn't build on top of the map. although the exact same hotspot in the panorama space works. Maybe I need to try different values:
Code
Display More<!-- the map image --> <!-- onclick="openmap();" --> <layer name="floormap" url="%SWFPATH%/floormap.png" keep="true" handcursor="false" capture="true" visible="false" align="center" scale="0.55" scale.mobile="0.30" scalechildren="true" alpha="1.0" maskchildren="false" > </layer> <!-- icon hotspots WORK! --> <style name="floorspot" keep="true" url="skin/camiconmyw.png" parent="floormap" align="lefttop" edge="center" scale="1.0" scale.mobile="1.250" /> <layer name="floorspot01" style="floorspot|tooltip" tooltip="Apart_1" x="100" y="100" zorder="3" onclick="mapspot_loadscene(scene_01hall, null, MERGE, BLEND(0.5)); closefloormap()" /> <!-- layer rectangular WORK --> <layer type="container" keep="true" parent="floormap" align="lefttop" x="150" y="150" width="250" height="250" bgcolor="0xFFFFFF" bgalpha="0.5" bgcapture="true"> </layer> <!-- poly hotspot NOT WORK --> <hotspot name="h7_t" style="letter" keep="true" parent="floormap" onhover="showtext(Textstyle DEFAULT);" > <point ath="2.000" atv="2.000" /> <point ath="4.000" atv="2.000" /> <point ath="4.000" atv="4.000" /> <point ath="2.000" atv="4.000" /> </hotspot> -
This is because a flat panorama is just a really small picture inside the space of a spherical panorama.
You can either just figure out and use ath/atv or calculate it from pixel x/y.
I for example use thousands of perfectly pixel aligned hotspots on a flat panorama which get automatically calculated from the corresponding pixel coordinates.
Thanks!
Yes, I understand how it should work and it works on the panorama, but I can't repeat it on the image layer. And I began to doubt whether it was possible in this way.Code
Display More<!-- the map image --> <!-- onclick="openmap();" --> <layer name="floormap" url="%SWFPATH%/floormap.png" keep="true" handcursor="false" capture="true" visible="false" align="center" scale="0.55" scale.mobile="0.30" scalechildren="true" alpha="1.0" maskchildren="false" > </layer> <!-- icon hotspots WORK! --> <style name="floorspot" keep="true" url="skin/camiconmyw.png" parent="floormap" align="lefttop" edge="center" scale="1.0" scale.mobile="1.250" /> <layer name="floorspot01" style="floorspot|tooltip" tooltip="Apart_1" x="100" y="100" zorder="3" onclick="mapspot_loadscene(scene_01hall, null, MERGE, BLEND(0.5)); closefloormap()" /> <!-- layer rectangular WORK --> <layer type="container" keep="true" parent="floormap" align="lefttop" x="150" y="150" width="250" height="250" bgcolor="0xFFFFFF" bgalpha="0.5" bgcapture="true"> </layer> <!-- poly hotspot NOT WORK --> <hotspot name="h7_t" style="letter" keep="true" parent="floormap" onhover="showtext(Textstyle DEFAULT);" > <point ath="2.000" atv="2.000" /> <point ath="4.000" atv="2.000" /> <point ath="4.000" atv="4.000" /> <point ath="2.000" atv="4.000" /> </hotspot> -
If I've missed something in the code, I'd appreciate some advice.
Or for ideas on how to implement it alternatively
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!