]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/routing.js.erb
refresh search if showing and user changes provider
[rails.git] / app / assets / javascripts / routing.js.erb
index 3c6db9999888703ea310a0f0b5ef57777cf383ff..4ea30fa000759677b03f8c20c1757e62d9af54f4 100644 (file)
@@ -252,6 +252,9 @@ OSM.Routing=function(map,name,jqSearch) {
        // Choose an engine on dropdown change
        r.selectEngine=function(e) {
                r.chosenEngine=r.engines[e.target.selectedIndex];
+               if (r.polyline){ // and if a route is currently showing, must also refresh, else confusion
+                       r.requestRoute(true);
+               }
        };
        // Choose an engine by name
        r.chooseEngine=function(name) {