changed behaviour of geocoder (return always triggers geocoder, moving a

single marker clears search results)
This commit is contained in:
shiin
2012-04-09 11:59:32 +02:00
parent 0fd8d4d8cf
commit 213bb71b35
5 changed files with 28 additions and 11 deletions
+10 -1
View File
@@ -83,7 +83,16 @@ showMarker: function(marker_id) {
},
// changed: any inputbox (is called when return is pressed [after] or focus is lost [before])
// keyup: force geocoder when enter is pressed
// (change event can be triggered, too; second call to geocoder gets fenced by JSONP)
// (alternative: track changes manually and only permit keyup event, if there was no change)
// do we want this?
keyUp: function(e, marker_id) {
if(e.keyCode==13)
OSRM.RoutingGUI.inputChanged(marker_id);
},
// changed: any inputbox (is called when enter is pressed [after] or focus is lost [before])
inputChanged: function(marker_id) {
if( marker_id == OSRM.C.SOURCE_LABEL)
OSRM.Geocoder.call(OSRM.C.SOURCE_LABEL, document.getElementById('gui-input-source').value);