In the Homogeneous Fields plugin, there is a function self.distance which calculates the distance in meters between two latLng coordinates. This is redundant. A distanceTo function is already included in IITC.
By setting the Portal's LatLng property to the Leaflet type LatLng it's possible to use its distanceTo function:
return portal1.distanceTo(portals2);
But it returns slightly different results (around 0.1% diff or 1m on 1km). Using the same that is already used in IITC would make sense, but maybe the custom one is more accurate - I did not test it.
In the Homogeneous Fields plugin, there is a function
self.distance
which calculates the distance in meters between two latLng coordinates. This is redundant. AdistanceTo
function is already included in IITC.By setting the Portal's LatLng property to the Leaflet type LatLng it's possible to use its distanceTo function:
return portal1.distanceTo(portals2);
But it returns slightly different results (around 0.1% diff or 1m on 1km). Using the same that is already used in IITC would make sense, but maybe the custom one is more accurate - I did not test it.