]> git.openstreetmap.org Git - rails.git/commitdiff
Merge pull request #11 from danstowell/jsrouting-pulldownchange
authorRichard Fairhurst <richard@systemeD.net>
Fri, 7 Mar 2014 15:58:04 +0000 (15:58 +0000)
committerRichard Fairhurst <richard@systemeD.net>
Fri, 7 Mar 2014 15:58:04 +0000 (15:58 +0000)
refresh search if showing and user changes provider

app/assets/javascripts/routing.js.erb

index 6a8961a7c8bac62c0212d4449f2b49d2601a2459..fbec3e7e3ada6e072eea4fd87ffdd670782dd837 100644 (file)
@@ -254,6 +254,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) {