Merge pull request #11 from danstowell/jsrouting-pulldownchange
[rails.git] / 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) {