using viewbox, removing zoom-on-route
This commit is contained in:
parent
1c76c992c1
commit
05410d5587
@ -34,7 +34,7 @@ call: function(marker_id, query) {
|
|||||||
if(query=="")
|
if(query=="")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//geo coordinates given -> directly draw results
|
// geo coordinates given -> directly draw results
|
||||||
if(query.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*[,;]\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
|
if(query.match(/^\s*[-+]?[0-9]*\.?[0-9]+\s*[,;]\s*[-+]?[0-9]*\.?[0-9]+\s*$/)){
|
||||||
var coord = query.split(/[,;]/);
|
var coord = query.split(/[,;]/);
|
||||||
OSRM.Geocoder._onclickResult(marker_id, coord[0], coord[1]);
|
OSRM.Geocoder._onclickResult(marker_id, coord[0], coord[1]);
|
||||||
@ -42,11 +42,11 @@ call: function(marker_id, query) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//build request for geocoder
|
// build basic request for geocoder
|
||||||
var call = OSRM.DEFAULTS.HOST_GEOCODER_URL + "?format=json&json_callback=%jsonp" + OSRM.DEFAULTS.GEOCODER_BOUNDS + "&accept-language="+OSRM.Localization.current_language+"&q=" + query;
|
var call = OSRM.DEFAULTS.HOST_GEOCODER_URL + "?format=json&json_callback=%jsonp" + OSRM.DEFAULTS.GEOCODER_BOUNDS + "&accept-language="+OSRM.Localization.current_language+"&q=" + query;
|
||||||
// // prioritize results in given viewbox=<left>,<top>,<right>,<bottom>
|
// prioritize results in currently shown mapview
|
||||||
// var bounds = OSRM.G.map.getBounds();
|
var bounds = OSRM.G.map.getBounds();
|
||||||
// call += "&viewbox=" + bounds._southWest.lat + "," + bounds._northEast.lng + "," + bounds._northEast.lat + "," + bounds._southWest.lng;
|
call += "&viewbox=" + bounds._southWest.lat + "," + bounds._northEast.lng + "," + bounds._northEast.lat + "," + bounds._southWest.lng;
|
||||||
OSRM.JSONP.call( call, OSRM.Geocoder._showResults, OSRM.Geocoder._showResults_Timeout, OSRM.DEFAULTS.JSONP_TIMEOUT, "geocoder_"+marker_id, {marker_id:marker_id,query:query} );
|
OSRM.JSONP.call( call, OSRM.Geocoder._showResults, OSRM.Geocoder._showResults_Timeout, OSRM.DEFAULTS.JSONP_TIMEOUT, "geocoder_"+marker_id, {marker_id:marker_id,query:query} );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -181,10 +181,6 @@ _snapRoute: function() {
|
|||||||
OSRM.Geocoder.updateAddress(OSRM.C.TARGET_LABEL);
|
OSRM.Geocoder.updateAddress(OSRM.C.TARGET_LABEL);
|
||||||
|
|
||||||
OSRM.G.markers.relabelViaMarkers();
|
OSRM.G.markers.relabelViaMarkers();
|
||||||
|
|
||||||
// focus on route after computation
|
|
||||||
// var bounds = new L.LatLngBounds( OSRM.G.route._current_route.getPositions() );
|
|
||||||
// OSRM.G.map.fitBoundsUI(bounds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user