Google Maps Distance Plugin
distance.swf
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!
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>
-
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.
This example is included with the plugin.