Fix hash formatting for POI at 0,0
Opening this URL and moving the map produces `pois=NaN,NaN` in the URL hash: https://brouter.de/brouter-web/#map=2/0/0/standard&pois=0,0,Null%20Island
This commit is contained in:
parent
43b1b70a0a
commit
2493fd6465
1 changed files with 2 additions and 2 deletions
|
|
@ -509,9 +509,9 @@ L.BRouter = L.Class.extend({
|
||||||
// formats L.LatLng object as lng,lat string
|
// formats L.LatLng object as lng,lat string
|
||||||
_formatLatLng: function (latLng) {
|
_formatLatLng: function (latLng) {
|
||||||
var s = '';
|
var s = '';
|
||||||
s += L.Util.formatNum(latLng.lng || latLng[1], L.BRouter.PRECISION);
|
s += L.Util.formatNum(latLng.lng ?? latLng[1], L.BRouter.PRECISION);
|
||||||
s += L.BRouter.NUMBER_SEPARATOR;
|
s += L.BRouter.NUMBER_SEPARATOR;
|
||||||
s += L.Util.formatNum(latLng.lat || latLng[0], L.BRouter.PRECISION);
|
s += L.Util.formatNum(latLng.lat ?? latLng[0], L.BRouter.PRECISION);
|
||||||
return s;
|
return s;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue