';
route_desc += '';
- route_desc += ' ';
+ route_desc += ' ';
route_desc += " | ";
route_desc += '';
@@ -99,7 +99,7 @@ show: function(response) {
OSRM.printwindow.document.getElementById('description').innerHTML = route_desc;
// init map
- var map = OSRM.printwindow.initialize();
+ var map = OSRM.printwindow.initialize( OSRM.DEFAULTS.TILE_SERVERS[0] );
var markers = OSRM.G.markers.route;
map.addLayer( new L.MouseMarker( markers[0].getPosition(), {draggable:false,clickable:false,icon:OSRM.G.icons['marker-source']} ) );
for(var i=1, size=markers.length-1; i
-
-
-
+
+
diff --git a/WebContent/printing/printing.js b/WebContent/printing/printing.js
new file mode 100644
index 000000000..c5da44095
--- /dev/null
+++ b/WebContent/printing/printing.js
@@ -0,0 +1,49 @@
+/*
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU AFFERO General Public License as published by
+the Free Software Foundation; either version 3 of the License, or
+any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+or see http://www.gnu.org/licenses/agpl.txt.
+*/
+
+// OSRM initialization
+// [for printing window]
+
+OSRM = {};
+OSRM.GLOBALS = {};
+OSRM.GUI = { visible:false };
+OSRM.G = OSRM.GLOBALS;
+
+// function to initialize a map in the new window
+function initialize(tile_server) {
+ // setup map
+ var tile_layer = new L.TileLayer(tile_server.url, tile_server.options);
+ OSRM.G.map = new OSRM.MapView("map", {
+ center: new L.LatLng(51.505, -0.09),
+ zoom: 13,
+ zoomAnimation: false,
+ fadeAnimation: false,
+ layers: [tile_layer],
+ attributionControl: false,
+ zoomControl: false,
+ dragging:false,
+ scrollWheelZoom:false,
+ touchZoom:false,
+ doubleClickZoom:false
+ });
+ return OSRM.G.map;
+}
+
+//print the window
+function printWindow() {
+ window.print();
+}
\ No newline at end of file
diff --git a/WebContent/printing/printing_screen.css b/WebContent/printing/printing_screen.css
deleted file mode 100644
index a1ae513f0..000000000
--- a/WebContent/printing/printing_screen.css
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU AFFERO General Public License as published by
-the Free Software Foundation; either version 3 of the License, or
-any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU Affero General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-or see http://www.gnu.org/licenses/agpl.txt.
-*/
-
-/* OSRM CSS styles for printing*/
-
-
-/* printer button */
-.printer-inactive
-{
- cursor:pointer;
- width:16px;
- height:16px;
- background-image:url("../images/printer_inactive.png");
-}
-.printer
-{
- cursor:pointer;
- width:16px;
- height:16px;
- background-image:url("../images/printer.png");
-}
-.printer:hover
-{
- background-image:url("../images/printer_hover.png");
-}
-.printer:active
-{
- background-image:url("../images/printer_active.png");
-}
-
-/* route summary */
-.route-summary
-{
- font-size: 12px;
-}
-
-/* route description box */
-#description
-{
- position:absolute;
- bottom:15px;
- top:60px;
- width:380px;
- font-size:12px;
- margin:5px;
-}
-.results-table
-{
- border-spacing:0px;
-}
-.results-odd
-{
- background-color: #FAF3E9; //#ffffff;
-}
-.results-even
-{
- background-color: #F2DE9C; //#ffffe0;
-}
-.result-items
-{
- text-align:left;
- vertical-align: middle;
- width:100%;
- padding-left:1px;
- padding-right:1px;
- padding-top:1px;
- padding-bottom:1px;
-}
-.result-direction
-{
- width:30px;
- padding-left:1px;
- padding-right:1px;
- padding-top:1px;
- padding-bottom:1px;
-}
-.result-distance
-{
- text-align:right;
- vertical-align: middle;
- width:30px;
- padding-left:1px;
- padding-right:1px;
- padding-top:1px;
- padding-bottom:1px;
-}
-.result-item
-{
- cursor:pointer;
- color:#000000
-}
|