increased zoom level for route description (new config entry),
removed some deprecated comments
This commit is contained in:
parent
fe6d854e11
commit
92dbadebae
@ -58,11 +58,9 @@ getLng: function() {
|
|||||||
isShown: function() {
|
isShown: function() {
|
||||||
return this.shown;
|
return this.shown;
|
||||||
},
|
},
|
||||||
centerView: function(zooming) {
|
centerView: function(zoom) {
|
||||||
var zoom = OSRM.DEFAULTS.ZOOM_LEVEL;
|
if( zoom == undefined )
|
||||||
if( zooming == false )
|
zoom = OSRM.DEFAULTS.ZOOM_LEVEL;
|
||||||
zoom = OSRM.G.map.getZoom();
|
|
||||||
//OSRM.G.map.setView( new L.LatLng( this.position.lat, this.position.lng-0.02), zoom); // dirty hack
|
|
||||||
OSRM.G.map.setView( new L.LatLng( this.position.lat, this.position.lng), zoom);
|
OSRM.G.map.setView( new L.LatLng( this.position.lat, this.position.lng), zoom);
|
||||||
},
|
},
|
||||||
toString: function() {
|
toString: function() {
|
||||||
|
@ -30,6 +30,7 @@ OSRM.DEFAULTS = {
|
|||||||
ONLOAD_LONGITUDE: 10.10,
|
ONLOAD_LONGITUDE: 10.10,
|
||||||
ONLOAD_SOURCE: "",
|
ONLOAD_SOURCE: "",
|
||||||
ONLOAD_TARGET: "",
|
ONLOAD_TARGET: "",
|
||||||
|
HIGHLIGHT_ZOOM_LEVEL: 16,
|
||||||
LANGUAGE: "en",
|
LANGUAGE: "en",
|
||||||
GEOCODER_BOUNDS: '&bounded=1&viewbox=-27.0,72.0,46.0,36.0'
|
GEOCODER_BOUNDS: '&bounded=1&viewbox=-27.0,72.0,46.0,36.0'
|
||||||
};
|
};
|
||||||
|
@ -63,7 +63,7 @@ function callGeocoder(marker_id, query) {
|
|||||||
|
|
||||||
|
|
||||||
// helper function for clicks on geocoder search results
|
// helper function for clicks on geocoder search results
|
||||||
function onclickGeocoderResult(marker_id, lat, lon, do_reverse_geocode, zoom ) {
|
function onclickGeocoderResult(marker_id, lat, lon, do_reverse_geocode, do_zoom ) {
|
||||||
var index;
|
var index;
|
||||||
if( marker_id == OSRM.C.SOURCE_LABEL )
|
if( marker_id == OSRM.C.SOURCE_LABEL )
|
||||||
index = OSRM.G.markers.setSource( new L.LatLng(lat, lon) );
|
index = OSRM.G.markers.setSource( new L.LatLng(lat, lon) );
|
||||||
@ -74,8 +74,9 @@ function onclickGeocoderResult(marker_id, lat, lon, do_reverse_geocode, zoom ) {
|
|||||||
|
|
||||||
if( do_reverse_geocode == true )
|
if( do_reverse_geocode == true )
|
||||||
updateReverseGeocoder(marker_id);
|
updateReverseGeocoder(marker_id);
|
||||||
if( zoom == undefined )
|
var zoom = undefined;
|
||||||
zoom = true;
|
if( do_zoom == false )
|
||||||
|
zoom = OSRM.G.map.getZoom();
|
||||||
|
|
||||||
OSRM.G.markers.route[index].show();
|
OSRM.G.markers.route[index].show();
|
||||||
if( !OSRM.G.markers.route[index].dirty_move || OSRM.G.markers.route[index].dirty_type )
|
if( !OSRM.G.markers.route[index].dirty_move || OSRM.G.markers.route[index].dirty_type )
|
||||||
|
@ -93,7 +93,7 @@ function initLocale() {
|
|||||||
|
|
||||||
// centering on geolocation
|
// centering on geolocation
|
||||||
function callbak_centerOnGeolocation( position ) {
|
function callbak_centerOnGeolocation( position ) {
|
||||||
OSRM.G.map.setView( new L.LatLng( position.coords.latitude, position.coords.longitude-0.02), OSRM.DEFAULTS.ZOOM_LEVEL);
|
OSRM.G.map.setView( new L.LatLng( position.coords.latitude, position.coords.longitude), OSRM.DEFAULTS.ZOOM_LEVEL);
|
||||||
}
|
}
|
||||||
function centerOnGeolocation() {
|
function centerOnGeolocation() {
|
||||||
if (navigator.geolocation)
|
if (navigator.geolocation)
|
||||||
|
@ -122,7 +122,7 @@ function onClickRouteDescription(geometry_index) {
|
|||||||
|
|
||||||
OSRM.G.markers.highlight.setPosition( positions[geometry_index] );
|
OSRM.G.markers.highlight.setPosition( positions[geometry_index] );
|
||||||
OSRM.G.markers.highlight.show();
|
OSRM.G.markers.highlight.show();
|
||||||
OSRM.G.markers.highlight.centerView();
|
OSRM.G.markers.highlight.centerView(OSRM.DEFAULTS.HIGHLIGHT_ZOOM_LEVEL);
|
||||||
}
|
}
|
||||||
function onClickCreateShortcut(src){
|
function onClickCreateShortcut(src){
|
||||||
OSRM.JSONP.call(OSRM.DEFAULTS.HOST_SHORTENER_URL+src+'&jsonp=showRouteLink', showRouteLink, showRouteLink_TimeOut, 2000, 'shortener');
|
OSRM.JSONP.call(OSRM.DEFAULTS.HOST_SHORTENER_URL+src+'&jsonp=showRouteLink', showRouteLink, showRouteLink_TimeOut, 2000, 'shortener');
|
||||||
|
Loading…
Reference in New Issue
Block a user