-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
I tries make some fake map, so I use L.CRS.Simple
there I need possibility to get distance between two points on the map, but the method distanceTo() count the distance depend of Earth that have no sense with L.CRS.Simple
as temporary solution I use:
L.LatLng.prototype.distanceToCRSSimple = function(other) {
other = L.latLng(other);
var lngS = 0, latS = 0;
lngS = other.lng - this.lng;
lngS = lngS * lngS;
latS = other.lat - this.lat;
latS = latS * latS;
return Math.sqrt(lngS + latS);
};hope you will find better solution in future