mike40033 / iitc-57Cell

iitc plugins I may make from time to time, if any
Other
4 stars 1 forks source link

HCF: distance between Portals function #3

Closed Heistergand closed 1 year ago

Heistergand commented 1 year ago

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.

mike40033 commented 1 year ago

It's probably safe to switch to the same one IITC uses...

mike40033 commented 1 year ago

This can be closed now, yes? I just landed your patch2...

Heistergand commented 1 year ago

yes. Closed in #4