Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
|
|
Quellcode |
1 2 3 |
krpano.call("addhotspot("+spotname+")");
var hotspot:Object = krpano.get("hotspot["+spotname+"]");
...
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 |
for each(var i:Object in response.list) {
var krcode:String = "createSpot(" +
i.id+ "," +
i.ath + "," +
i.atv + "," +
i.info + ")";
kr.krpano.call(krcode);
}
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 |
<action name="createSpot"> addhotspot(hs-%1); hotspot[hs-%1].loadstyle(myspot); set(hotspot[hs-%1].ath,%2); set(hotspot[hs-%1].atv,%3); set(hotspot[hs-%1].info,%4); </action> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
krpanoObj.createarray("newhotspots");
newHotspotsArray = krpanoObj.newhotspots
for each(var i:Object in response.list) {
var nh:Object = newHotspotsArray.createItem("hs-" + i.id);
nh.registerattribute("ath",i.ath);
nh.registerattribute("atv",i.atv);
nh.registerattribute("info",i.info);
}
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
<action name="createNewHotspots"> foreach(plugin[myplugin].newtags,panotag-tmpi, panotag-tmpo, createSpot( get(panotag-tmpo.name), get(panotag-tmpo.ath), get(panotag-tmpo.atv), get(panotag-tmpo.info)); <!-- mod(panotag-tmpm, panotag-tmpi,80); if( panotag-tmpi, wait(0)); --> ); </action> <!-- %1 - type of data %2 - iterator variable %3 - variable where the object will be stored %4 - action --> <action name="foreach"> set(%2,0); loop(%1[get(%2)] !== null, copy(%3, %1[get(%2)]); %4; inc(%2); ); </action> |
|
|
Quellcode |
1 |
<hotspot name="panotag-pi-ts-0" style="panotag-tagspot" visible="false"/><hotspot name="panotag-pi-ts-1" style="panotag-tagspot" visible="false"/><hotspot name="panotag-pi-ts-2" style="panotag-tagspot" visible="false"/>(...) |
What´s the problem with this code please?
wrong order - first you need the add the hotspot and then you can get it,var spot:Object = _krPano.get("hotspot[" + spotname + "]");
_krPano.call("addhotspot(" + spotname +")");
the ath/atv coordinates are spherical 360/180 coordinates in degrees, using 'x/y' screen coordinates here is not correct,spot.ath =e.PosicaoX;
spot.atv = e.PosicaoY;