refresh search if showing and user changes provider
authorDan Stowell <danstowell@users.sourceforge.net>
Sun, 23 Feb 2014 21:40:21 +0000 (21:40 +0000)
committerDan Stowell <danstowell@users.sourceforge.net>
Sun, 23 Feb 2014 22:15:38 +0000 (22:15 +0000)
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) {