X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f18740a7af8bf9252a20cec08d6fce2dc6229111..fa339033e1f00f4f3e2b9c790c5100a863cf91ac:/app/assets/javascripts/osm.js.erb diff --git a/app/assets/javascripts/osm.js.erb b/app/assets/javascripts/osm.js.erb index d2fc81e38..eb5ce64f3 100644 --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@ -22,8 +22,8 @@ OSM = { return url; }, - mapParams: function (search) { - var params = {}, mapParams = {}, bounds, loc; + params: function(search) { + var params = {}; search = (search || window.location.search).replace('?', '').split(/&|;/); @@ -35,6 +35,12 @@ OSM = { params[key] = decodeURIComponent(val); } + return params; + }, + + mapParams: function (search) { + var params = OSM.params(search), mapParams = {}, bounds, loc; + if (params.mlon && params.mlat) { mapParams.marker = true; mapParams.mlon = parseFloat(params.mlon);