X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c55d346d5f7501fd6f5f636e85c8a60ec67d88ee..1bee96ede16e1dab41ad82efb9f2486da68a642f:/app/assets/javascripts/edit/id.js.erb diff --git a/app/assets/javascripts/edit/id.js.erb b/app/assets/javascripts/edit/id.js.erb index 02299d215..90318788c 100644 --- a/app/assets/javascripts/edit/id.js.erb +++ b/app/assets/javascripts/edit/id.js.erb @@ -4,12 +4,13 @@ $(document).ready(function () { var id = $("#id-embed"); if (id.data("configured") === true) { - var hashParams = OSM.params(location.hash.substring(1)); + var hash = location.hash.substring(1); + var hashParams = hash ? OSM.params(hash) : {}; var mapParams = OSM.mapParams(); var params = {}; if (mapParams.object) { - params.id = mapParams.object.type[0] + mapParams.object.id; + params.id = mapParams.object.type + '/' + mapParams.object.id; mapParams = OSM.parseHash(location.hash); if (mapParams.center) { params.map = mapParams.zoom + '/' + mapParams.center.lat + '/' + mapParams.center.lng;