]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index.js
Merge pull request #13 from danstowell/jsrouting-ffoxdragok
[rails.git] / app / assets / javascripts / index.js
index fc772a1a8692cb93fbed2ce45cd988e98d45db09..0a11b489989f67dbf7a2133a80c0137e4f26b45c 100644 (file)
@@ -327,7 +327,7 @@ $(document).ready(function () {
     e.preventDefault();
     if ($(".query_wrapper.routing").is(":visible")) {
       // Routing
-      OSM.routing.requestRoute();
+      OSM.routing.requestRoute(true, false);
     } else {
       // Search
       $("header").addClass("closed");
@@ -349,7 +349,7 @@ $(document).ready(function () {
   });
 
   OSM.routing = OSM.Routing(map,'OSM.routing',$('.query_wrapper.routing'));
-  OSM.routing.chooseEngine('Car (OSRM)');
+  OSM.routing.chooseEngine('javascripts.directions.engines.osrm_car');
 
   $(".get_directions").on("click",function(e) {
     e.preventDefault();
@@ -357,7 +357,7 @@ $(document).ready(function () {
     $(".routing").show();
     $(".query_wrapper.routing [name=route_from]").focus();
     $("#map").on('dragend dragover',function(e) { e.preventDefault(); });
-    $("#map").on('drop',function(e) { OSM.routing.handleDrop(e); });
+    $("#map").on('drop',function(e) { OSM.routing.handleDrop(e); e.preventDefault(); });
     $(".routing_marker").on('dragstart',function(e) {
     e.originalEvent.dataTransfer.effectAllowed = 'move';
       e.originalEvent.dataTransfer.setData('id', this.id);