|
|
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 29 30 31 32 33 34 35 36 37 38 39 40 |
<plugin name="gmaps" url="http://localhost/vtours/live/plugins/googlemaps.swf" keep="true" visible="true" enabled="true" handcursor="false" capture="true" children="true" zorder="1000" alpha="1.00" blendmode="normal" smoothing="true" origin="left" edge="" x="0" y="0" width="245" height="475" scale="1" onloaded="" onover="" onhover="" onout="" ondown="" onup="" onclick="" scrollwheel="true" dragging="true" maptype="SATELLITE" zoom="14" key="" onmapready="updatespot(sp_1);" > <radar alpha="0.25" behindspots="true" dragable="true" fillalpha="1.0" fillcolor="0x9999FF" glow="true" glowcolor="0" glowstrength="3" glowwidth="4" linealpha="0.0" linecolor="0xFFFFFF" linewidth="0.0" size="100" visible="true" /> <spot name="sp_1" heading="-90" lat="17.4675902" lng="78.5565376" onhover="showtext(Spot 1);" /> <spot name="sp_3" heading="-90" lat="17.4713563" lng="78.5632324" onhover="showtext(Spot 3);" /> </plugin> |
|
|
Quellcode |
1 2 3 4 |
krpano().get().call("addplugin(gmaps);");
krpano().get().call("set(plugin[gmaps].lat, 12);");
krpano().get().call("set(plugin[gmaps].lng, 121);");
.....
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »srisa« (24. August 2010, 12:46)
for adding spots you would need to call the googlemaps addspot function,That will add the google map and the radar. How do i go about adding the spot so that it will appear as mentioned in the xml above? That is, how do i add the radar and spot sub-nodes to the google maps plugin with javascript?
|
|
Quellcode |
1 2 3 4 5 6 7 8 |
var krp = krpano();
krp.call("addplugin(gmaps);");
krp.set("plugin[gmaps].lat", 12);
krp.set("plugin[gmaps].lng", 121);
krp.call("plugin[gmaps].addspot(spot1,12,121);");
krp.call("plugin[gmaps].addspot(spot2,13,122);");
krp.call("plugin[gmaps].addspot(spot3,14,123);");
krp.set("plugin[gmaps].radar.visible", true);
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
// this is for adding the map
krp.call("addplugin(gmap)");
krp.set("plugin[gmap].url", url);
krp.set("plugin[gmap].lat", lat);
krp.set("plugin[gmap].lng", lng);
// After a time out of few seconds, code for adding the spot and the radar
krp.call("plugin[gmap].addspot(spot1, 60, 120, 90);");
krp.call("plugin[gmap].updatespots();"); // this is important
krp.set("plugin[gmap].radar.keep", true);
krp.set("plugin[gmap].radar.enabled", true);
krp.set("plugin[gmap].radar.visible", true);
krp.call("plugin[gmap].activatespot(spot1);");
krp.call("plugin[gmap].pantospot(spot1);");
|
right, sorry, I forgot, it needs a bit time until the googlemaps functions (like addspot,...) are added,The spot is appearing only if there is a gap of few seconds after the addition of the map.
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
...
krp.set("plugin[gmap].onmapready", "js( krpano_googlemaps_ready() )" );
function krpano_googlemaps_ready()
{
krp.call("plugin[gmap].addspot(spot1, 60, 120, 90);");
krp.call("plugin[gmap].updatespots();"); // this is important
// ...
}
|
|
|
Quellcode |
1 2 3 4 5 6 |
krp.set("plugin[gmap].zoomcontrol.visible", true);
krp.set("plugin[gmap].zoomcontrol.keep", true);
krp.set("plugin[gmap].zoomcontrol.enabled", true);
krp.set("plugin[gmap].zoomcontrol.anchor", "bottomright");
krp.set("plugin[gmap].zoomcontrol.x", 5);
krp.set("plugin[gmap].zoomcontrol.y", 5);
|
yes, have a look at here - http://krpano.com/plugins/googlemaps/ - for updatecontrols(),Am i missing something?