PanotourMaps API
From Autopano
Contents |
PanotourMaps Plugin
XML Structure
<plugin name="panotourmaps" url="PanotourMaps.swf" ...> <spot> <zoomcontrol> <positioncontrol> <maptypecontrol> <radar> <overlay> </plugin>
Attributes
- key - the Google maps API key if you want to use Google Maps layer
to use the Google maps services a Google maps API key is needed
To sign up for the Google Maps API follow this link
- mapgis the Geographic Information System used to display the map, the possible GIS are:
- google (default if key attribute is set)
- openstreetmap (default if key attribute is not set)
- maptype the type of the map, possible types:
- SATELLITE (default)
- NORMAL
- PHYSICAL
- HYBRID
- lat
Latitude - Geographic Coordinates
the current map position
- lng
Longitude - Geographic Coordinates
the current map position
- zoom
the start zoom level
- dragging
dragging allowed? - true or false - default=true
- scrollwheel
scrollwheel allowed? - true or false - default=true
- continuouszoom
continuous zooming - true or false - default=false
- keyboard
keyboard navigation - true or false - default=false
- crosshairs
show crosshairs - true or false - default=false
- onmapready - event
action / as3 function that will be called when loading the maps plugin is done and it's ready for using
- onmapmoved - event
action / as3 function that will be called when the map has moved
- onmapzoomed - event
action / as3 function that will be called when the map has zoomed
Spot
Create spots on the PanotourMaps plugin with the <spot> subnode:
example:
<spot name="s1" lat="44.959808" lng="14.407729" heading="0" />
Attributes
- name
name of the spot, must be defined!
- lat
Latitude - Geographic Coordinates the spot position
- lng
Longitude - Geographic Coordinates the spot position
- heading
0-360, heading of the panorama linked with this spot
mandatory to align the radar in the good direction
- url
path to the icon that will be used to display the spot
- animate
indicates if the spot should be animated and when
Possible values are :
- NEVER
- ALWAYS
- WHEN_ACTIVATED (default)
- onover - event
action that will be called when mouse comes overs the spot
- onhover - event
action that will called in intervals when mouse stays/hovers over the spot
use it for showtext() actions
- onout - event
action that will be called when mouse leaves the spot
- onclick - event
action that will be called when mouse clicks on spot
Position / Zoom / Map Type Controls
the default PanotourMaps controls can be added with the
<positioncontrol>, <zoomcontrol> and <maptypecontrol> subnodes:
example:
<positioncontrol visible="true" anchor="topleft" x="2" y="2" /> <zoomcontrol visible="true" anchor="topright" x="2" y="2" hasscrolltrack="true" /> <maptypecontrol visible="true"/>
If you do not specify any anchor, the plugin will place the control to a default place according to common usage of the displayed layer.
Attributes
- visible
visible state of the control, true or false, default=false
- anchor
anchor / align origin of the control
possible values: topleft, topright, bottomleft, bottomright
- x / y
offsets from the anchor
Radar
add a map radar <radar> subnode:
example:
<radar visible="true"
size="100"
alpha="0.5"
fillcolor="0xFFFFFF"
fillalpha="1.0"
linecolor="0xFFFFFF"
linealpha="0.0"
linewidth="0.0"
glow="true"
glowcolor="0xFFFFFF"
glowwidth="4"
glowstrength="3"
/>
Attributes
- visible
visible state of the radar, true or false, default=false
- size
radius of the radar in pixels, if it's larger than the map it will be clipped
- alpha
alpha value (0-1) of the radar, default=0.5
- fillcolor
fillcolor of the radar area, default=0xFFFFFF (white)
- fillalpha
alpha value (0-1) of the radar area, default=1.0
- linecolor
color of line around the radar area, default=0xFFFFFF (white)
- linealpha
alpha value (0-1) of line around the radar area, default=0.0
- linewidth
width of line around the radar area, default=0.0
- glow
enable a glow effect of the radar, default=true
- glowcolor
color of glow effect, default=0xFFFFFF (white)
- glowwidth
width / range of glow effect, default=4
- glowstrength
strength of glow effect, default=3
Overlay
You can add an overlay over the map layer and under the spots.
Attributes
- name
Name of the overlay
- url
Path of the image that will be displayed as overlay
- west
longitude of the west side of the overlay
- east
longitude of the east side of the overlay
- north
latitude of the north side of the overlay
- south
latitude of the south side of the overlay
- alpha
transparency of the overlay
PanotourMaps plugin XML / Actionscript / Javascript interface functions
XML calling example:
plugin[maps].activatespot(spot1); plugin[maps].pantospot(spot1);
Functions
- resetspots()
remove all spots
- addspot(name, lat, lng ,heading, active, onclick, onhover, onover, onout )
add a new spot
updatespots() must be called to show the added shots
(italic = optional parameters)
- updatespots()
updates all spots
must be called when spots are added or the attributes of a spots has changed
- activatespot(spotname)
activates the the spot with the name "spotname"
disables all other spots
- panto(lat, lng)
pans the map to coordinates lat/lng
- pantospot(spotname)
pans the map to center at the spot
- ensurespotvisible(spotname)
do nothing if the spot is visible, otherwise pans the map to center at the spot
- panby(xoffset, yoffset)
pans the map by xoffset/yoffset pixels
- zoomin() / zoomin( lat, lng, center, continuous )
zooms in the map by one zoom level if possible
optional parameters:
- lat / lng - if set, this is the point around which it zoom, otherwise it will zoom in around the center of the map
- center - if true, ot also want to center at lat/lng
- continuous - whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map)
- zoomout() / zoomout( lat, lng, continuous )
zooms out the map by one zoom level if possible
can be used for own controls
optional parameters:
- lat / lng - if set, this is the point around which it zoom, otherwise it will zoom in around the center of the map
- continuous - whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map)
- setzoom(zoomlevel , continuous )
zooms to "zoomlevel"
can be used for own controls
optional parameters:
- continuous - whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map)
- setcenter(lat, lng, zoomlevel)
set new lat/lng/zoom
can be used for own controls
- setmaptype(maptype)
set new maptype - "NORMAL","PHYSICAL","SATELLITE","HYBRID"
can be used for own controls
- updatecontrols()
parses and setup the "positioncontrol" and "zoomcontrol" settings
example xml code:
<krpano version="1.0.7">
<plugin name="panotourmaps"
url="PanotourMaps.swf"
keep="true"
handcursor="false"
align="leftbottom"
x="10"
y="10"
width="300"
height="300"
key=">>ENTER-HERE-YOUR-MAPS-KEY<<"
lat="44.959818"
lng="14.407840"
zoom="18"
maptype="SATELLITE"
dragging="true"
scrollwheel="true"
continuouszoom="false"
keyboard="false"
crosshairs="false"
onmapready=""
onmapmoved=""
onmapzoomed=""
>
<radar visible="true"
size="100"
alpha="0.5"
fillcolor="0xFFFFFF"
fillalpha="1.0"
linecolor="0xFFFFFF"
linealpha="0.0"
linewidth="0.0"
glow="true"
glowcolor="0xFFFFFF"
glowwidth="4"
glowstrength="3"
/>
<positioncontrol visible="true" />
<zoomcontrol visible="true" />
<maptypecontrol visible="true" />
<spot name="s1" lat="44.959808" lng="14.407729"
url="spoticon01.png"
onhover="showtext(Spot 1);"
onclick="action(s1);"
heading="0"
active="true"
/>
<spot name="s2" lat="44.959717" lng="14.407840"
url="spoticon02.png"
onhover="showtext(Spot 2);"
onclick="action(s2);"
heading="90"
/>
</plugin>
<action name="s1">
plugin[maps].activatespot(s1);
plugin[maps].pantospot(s1);
loadpano(pano1.xml,null,MERGE,BLEND(1));
</action>
<action name="s2">
plugin[maps].activatespot(s2);
plugin[maps].pantospot(s2);
loadpano(pano2.xml,null,MERGE,BLEND(1));
</action>
</krpano>

