fix for culture and icons

This commit is contained in:
DennisSchiefer 2012-08-14 13:46:46 +01:00
parent 5a2dd78694
commit 3ab5a22890
2 changed files with 10 additions and 9 deletions

View File

@ -176,10 +176,11 @@ show: function(response) {
print_window.document.getElementById('overview-map-description').innerHTML = '<table class="description medium-font">' + header + '</table>';
// draw map
var positions = OSRM.G.route.getPositions();
var tile_server_id = OSRM.G.map.getActiveLayerId();
var zoom = print_window.OSRM.drawMap( OSRM.DEFAULTS.TILE_SERVERS[tile_server_id], new L.LatLngBounds( positions ) );
var positions = OSRM.G.route.getPositions();
var bounds = new L.LatLngBounds( positions );
var zoom = print_window.OSRM.drawMap( OSRM.DEFAULTS.TILE_SERVERS[tile_server_id], bounds );
// draw markers
print_window.OSRM.prefetchIcons( OSRM.G.images );
print_window.OSRM.drawMarkers( OSRM.G.markers.route );
@ -235,7 +236,7 @@ printWindowLoaded: function(){
}
// localization
print_window.OSRM.Localization.current_language = OSRM.Localization.current_language;
print_window.OSRM.Localization.culture = OSRM.loc("CULTURE");
print_document.getElementById('description-label').innerHTML = OSRM.loc( "ROUTE_DESCRIPTION" );
print_document.getElementById('overview-map-label').innerHTML = OSRM.loc( "OVERVIEW_MAP" );
if( !OSRM.G.route.isRoute() || !OSRM.G.route.isShown() ) { // error message if no route available (can trigger if user refreshes print-window)

View File

@ -20,7 +20,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
OSRM = {};
OSRM.GLOBALS = { main_handle:{boxVisible:function(){return false;}} }; // needed for fitBoundsUI to work
OSRM.Localization = { current_language:"en"}; // needed for localized map tiles
OSRM.Localization = { culture:"en-US" }; // needed for localized map tiles
OSRM.G = OSRM.GLOBALS;
@ -41,7 +41,7 @@ OSRM.prefetchIcons = function(images_list) {
var LabelMarkerIcon = L.LabelMarkerIcon.extend({
options: {
shadowUrl: OSRM.G.images["marker-shadow"].getAttribute("src"),
shadowUrl: images_list["marker-shadow"].src,
iconSize: [25, 41],
shadowSize: [41, 41],
iconAnchor: [13, 41],
@ -49,7 +49,7 @@ OSRM.prefetchIcons = function(images_list) {
popupAnchor: [0, -33]
} });
for(var i=0; i<icon_list.length; i++) {
OSRM.G.icons[icon_list[i].id] = new LabelMarkerIcon({iconUrl: OSRM.G.images[icon_list[i].image_id].getAttribute("src")});
OSRM.G.icons[icon_list[i].id] = new LabelMarkerIcon({iconUrl: images_list[icon_list[i].image_id].getAttribute("src")});
}
};
@ -60,7 +60,7 @@ OSRM.drawMap = function(tile_server, bounds) {
var tile_layer;
if( tile_server.bing ) tile_layer = new L.BingLayer(tile_server.apikey, tile_server.options);
else tile_layer = new L.TileLayer(tile_server.url, tile_server.options);
tile_layer.options.culture = OSRM.loc("CULTURE");
tile_layer.options.culture = OSRM.Localization.culture;
OSRM.G.map = new OSRM.MapView("overview-map", {
center: new L.LatLng(48.84, 10.10),
zoom: 13,
@ -95,7 +95,7 @@ OSRM.drawMarkers = function( markers ) {
// manage route
OSRM.drawRoute = function( positions ) {
if( OSRM.G.route == undefined )
OSRM.G.route = new L.Polyline();
OSRM.G.route = new L.Polyline( [] );
OSRM.G.route.setLatLngs( positions );
OSRM.G.route.setStyle( {clickable:false,color:'#0033FF', weight:5, dashArray:""} );
OSRM.G.map.addLayer( OSRM.G.route );