### Calculate Point Distance

Example of calculating the distance in Meters between two points (requires the JavaObject library)
Sub MapDistanceBetween
'Calculate the distance in m between two points via a JavaObject
'Example: mDistance = MapDistanceBetween(mLatC, mLonC, mLatP, mLonP)
`Sub MapDistanceBetween(mLatFrom As Double, mLonFrom As Double, mLatTo As Double, mLonTo As Double) As Double
Dim joLatLonFrom As JavaObject
joLatLonFrom.InitializeNewInstance("com.lynden.gmapsfx.javascript.object.LatLong", Array(mLatFrom, mLonFrom))
Dim mLatLon As LatLng
mLatLon.Initialize(mLatTo, mLonTo)
Return joLatLonFrom.RunMethod("distanceFrom", Array(mLatLon))
End Sub`
Example
Dim mLatC As Double = 53.63746167
Dim mLonC As Double = 9.799283333
Dim mLatP As Double = 53.63746333
Dim mLonP As Double = 9.799173333
Dim mDistance As Double
mDistance = MapDistanceBetween(mLatC, mLonC, mLatP, mLonP)
mDistance = 7.26242412

Changed: , Category: Google Maps, File: T6C197M1443.htm, ID: 1443