X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bd2e999756de84c91593c693fcbef47778936a65..a2cf9b5b9f568c614ad8bbf8a477326b01cefb57:/app/assets/javascripts/leaflet.map.js diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index f433cd371..58360bbec 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -170,6 +170,24 @@ L.OSM.Map = L.Map.extend({ return str; }, + getGeoUri: function(marker) { + var precision = OSM.zoomPrecision(this.getZoom()), + latLng, + params = {}; + + if (marker && this.hasLayer(marker)) { + latLng = marker.getLatLng().wrap(); + } else { + latLng = this.getCenter(); + } + + 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; + }, + addObject: function(object, callback) { var objectStyle = { color: "#FF6200",