From 2734a38979131544b72727e5ae02d6d1664c99ca Mon Sep 17 00:00:00 2001 From: Will Bradley Date: Sun, 28 Jul 2013 06:29:24 -0400 Subject: [PATCH] Trying to add printing --- index.html | 20 ++++++++-- print.html | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 3 deletions(-) create mode 100644 print.html diff --git a/index.html b/index.html index 05974d2..b5cd542 100644 --- a/index.html +++ b/index.html @@ -32,6 +32,8 @@
+ +
@@ -94,10 +96,12 @@ },function(error){ console.log(error); updateMap("Tempe, Arizona",[[33.6569,-111.6801],[33.3133,-112.3276]]) + window.query = "Tempe, Arizona"; }); } else { updateMap("Tempe, Arizona",[[33.6569,-111.6801],[33.3133,-112.3276]]) + window.query = "Tempe, Arizona"; } } @@ -107,8 +111,6 @@ forwardLookup(query,function(xmlhttp) { // Decode response as JSON response = JSON.parse(xmlhttp.responseText); - console.log(response); - console.log("SUP"); if(response.length > 0){ // Display all results in sidebar @@ -176,7 +178,19 @@ // Fit map to the GPS boundaries map.fitBounds(bounds); - }; + } + + function printMap(){ + var bounds = map.getBounds(); + newwindow=window.open("print.html?q="+query + +"&b0="+bounds._northEast.lat + +"&b1="+bounds._northEast.lng + +"&b2="+bounds._southWest.lat + +"&b3="+bounds._southWest.lng + ,'name'); + if (window.focus) {newwindow.focus()} + return false; + } diff --git a/print.html b/print.html new file mode 100644 index 0000000..9cf25e4 --- /dev/null +++ b/print.html @@ -0,0 +1,111 @@ + + + + + + + + + + + +
+ + + + + + + \ No newline at end of file