X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/8376a430b6e8fb3de96b66a05c36cb8ac67e9c59..cf896fa0a7f92c3243d840ec57b820f7f1e9ad0c:/app/assets/javascripts/index/contextmenu.js diff --git a/app/assets/javascripts/index/contextmenu.js b/app/assets/javascripts/index/contextmenu.js index 1e7251ec6..080a4de72 100644 --- a/app/assets/javascripts/index/contextmenu.js +++ b/app/assets/javascripts/index/contextmenu.js @@ -8,7 +8,8 @@ OSM.initializeContextMenu = function (map) { lng = latlng.lng.toFixed(precision); OSM.router.route("/directions?" + querystring.stringify({ - route: lat + "," + lng + ";" + $("#route_to").val() + from: lat + "," + lng, + to: $("#route_to").val() })); } }); @@ -22,7 +23,8 @@ OSM.initializeContextMenu = function (map) { lng = latlng.lng.toFixed(precision); OSM.router.route("/directions?" + querystring.stringify({ - route: $("#route_from").val() + ";" + lat + "," + lng + from: $("#route_from").val(), + to: lat + "," + lng })); } }); @@ -47,7 +49,7 @@ OSM.initializeContextMenu = function (map) { lat = latlng.lat.toFixed(precision), lng = latlng.lng.toFixed(precision); - OSM.router.route("/search?query=" + encodeURIComponent(lat + "," + lng)); + OSM.router.route("/search?whereami=1&query=" + encodeURIComponent(lat + "," + lng)); } }); @@ -71,9 +73,8 @@ OSM.initializeContextMenu = function (map) { }); map.on("mousedown", function (e) { - if (e.shiftKey) map.contextmenu.disable(); - }).on("mouseup", function () { - map.contextmenu.enable(); + if (e.originalEvent.shiftKey) map.contextmenu.disable(); + else map.contextmenu.enable(); }); var updateMenu = function updateMenu () {