Merge remote-tracking branch 'upstream/pull/5581'
This commit is contained in:
commit
8f387236ce
9 changed files with 59 additions and 103 deletions
|
@ -152,13 +152,10 @@ L.OSM.Map = L.Map.extend({
|
|||
},
|
||||
|
||||
getUrl: function (marker) {
|
||||
var precision = OSM.zoomPrecision(this.getZoom()),
|
||||
params = {};
|
||||
const params = {};
|
||||
|
||||
if (marker && this.hasLayer(marker)) {
|
||||
var latLng = marker.getLatLng().wrap();
|
||||
params.mlat = latLng.lat.toFixed(precision);
|
||||
params.mlon = latLng.lng.toFixed(precision);
|
||||
[params.mlat, params.mlon] = OSM.cropLocation(marker.getLatLng(), this.getZoom());
|
||||
}
|
||||
|
||||
var url = window.location.protocol + "//" + OSM.SERVER_URL + "/",
|
||||
|
@ -236,21 +233,14 @@ L.OSM.Map = L.Map.extend({
|
|||
},
|
||||
|
||||
getGeoUri: function (marker) {
|
||||
var precision = OSM.zoomPrecision(this.getZoom()),
|
||||
latLng,
|
||||
params = {};
|
||||
let latLng = this.getCenter();
|
||||
const zoom = this.getZoom();
|
||||
|
||||
if (marker && this.hasLayer(marker)) {
|
||||
latLng = marker.getLatLng().wrap();
|
||||
} else {
|
||||
latLng = this.getCenter();
|
||||
latLng = marker.getLatLng();
|
||||
}
|
||||
|
||||
params.lat = latLng.lat.toFixed(precision);
|
||||
params.lon = latLng.lng.toFixed(precision);
|
||||
params.zoom = this.getZoom();
|
||||
|
||||
return "geo:" + params.lat + "," + params.lon + "?z=" + params.zoom;
|
||||
return `geo:${OSM.cropLocation(latLng, zoom).join(",")}?z=${zoom}`;
|
||||
},
|
||||
|
||||
addObject: function (object, callback) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue