From 3ab5a2289053b8df77657c415fd7f192bb83b381 Mon Sep 17 00:00:00 2001 From: DennisSchiefer Date: Tue, 14 Aug 2012 13:46:46 +0100 Subject: [PATCH] fix for culture and icons --- WebContent/printing/OSRM.Printing.js | 9 +++++---- WebContent/printing/printing.js | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index 212a7ea20..a84ef381e 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -176,10 +176,11 @@ show: function(response) { print_window.document.getElementById('overview-map-description').innerHTML = '' + header + '
'; // 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) diff --git a/WebContent/printing/printing.js b/WebContent/printing/printing.js index c9ad5e47e..8e062b0cc 100644 --- a/WebContent/printing/printing.js +++ b/WebContent/printing/printing.js @@ -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