merged two ideas of raphnik for testing
This commit is contained in:
parent
1973198f3d
commit
1c76c992c1
@ -10,4 +10,5 @@ Jean-Frederic
|
|||||||
Zbigniew Czernik
|
Zbigniew Czernik
|
||||||
Jonas Häggqvist
|
Jonas Häggqvist
|
||||||
Sabas
|
Sabas
|
||||||
Paul Spencer
|
Paul Spencer
|
||||||
|
Raphaël Pinson
|
@ -44,6 +44,9 @@ call: function(marker_id, query) {
|
|||||||
|
|
||||||
//build request for geocoder
|
//build 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>
|
||||||
|
// var bounds = OSRM.G.map.getBounds();
|
||||||
|
// 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,6 +181,10 @@ _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