manuelbieh / geolib

Zero dependency library to provide some basic geo functions
MIT License
4.21k stars 341 forks source link

OrderByDistance attempted to assign to readonly property #134

Closed adrianha closed 5 years ago

adrianha commented 7 years ago

Hi, Sometimes i got an error when using geolib.findNearest because its attempted to assign to readonly property. After i look at the code its raised because of this (Line: 950 on dist version): https://github.com/manuelbieh/Geolib/blob/master/src/geolib.js#L937-L939

Could we change to:

var augmentedCoord = {
  key: idx,
  distance: distance
};

Thanks

manuelbieh commented 5 years ago

This behavior is changed/fixed in v3 which I will release shortly!