News Examples Documentation Download Buy Forum Contact

Documentation

Plugins

XML Extensions

Tools


Third Party Software
for krpano

Google Maps Distance Plugin distance.swf
by spacerywirtualne.pl & panospherical.com - office@panospherical.com

Description

The plugin is calculating distance between 2 google map spots, using "Lat" and "Lng".
The result is given in meters and miles.
The plugin can be implemented offline, as all calculations are done without JavaScript.

Updates for this plugin are free!

here is the code:

<plugin name="dist" 
        url="distance.swf" 
        tofixed="1" 
        keep="true"
        mulnr="1000"
        />

use the following action:

plugin[dist].showdistance(lat1,lng1,lat2,lng2);

result:

var: kmdistance = kilometers
var: milesdistance = miles

Example:

<action name="onhoverdist">
    	plugin[dist].showdistance(get(lat1_temp),get(lng1_temp),get(plugin[maps].spot[%1].lat),get(plugin[maps].spot[%1].lng));
    	txtadd(tooltip, 'distance = ', get(kmdistance), '   km and ', get(milesdistance), ' mi  ');
    	showtext(get(tooltip));
</action> 
    

Plugin Attributes

  • tofixed - the number of digits after decimal point
    • tofixed="1" -> 124,1
    • tofixed="5" -> 124,12345
    • tofixed="0" -> 124
  • mulnr - divisor
    Remember do NOT divide by 0 (zero)!
    • mulnr="1" -> returns result in kilometers
    • mulnr="1000" -> returns result in meters
  • The result is calculated in both: kilometers and miles.

Example

This example is included with the plugin.
CLICK TO VIEW EXAMPLE