Style and usability tweaks

This commit is contained in:
Will Bradley 2013-07-28 22:03:09 -04:00
parent 9a4e091128
commit ee7d942858
2 changed files with 45 additions and 19 deletions

View File

@ -10,20 +10,28 @@
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
z-index: 999; z-index: 9999;
background-color: white; background-color: white;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
padding: 1em; padding: 1em;
border: 1px solid black; width: 15em;
height: 612px;
overflow-y: auto;
opacity: 0.8;
} }
#printbutton {
font-size: 1.5em;
font-weight: bold;
}
#map { #map {
padding: 1em;
border: 1px solid black;
height: 612px; /* 8.5 inch at 72 dpi */ height: 612px; /* 8.5 inch at 72 dpi */
width: 792px; /* 11 inch at 72 dpi */ width: 792px; /* 11 inch at 72 dpi */
} }
#results { #results {
margin: 0 0 0 1em; margin: 0 0 0 1em;
padding: 0; padding: 0;
width: 12em;
} }
#results li span { #results li span {
cursor: pointer; cursor: pointer;
@ -43,7 +51,13 @@
<form method="get" action="#" id="search_form"> <form method="get" action="#" id="search_form">
<input type="text" id="q" name="q" value="" /><input type="submit" /> <input type="text" id="q" name="q" value="" /><input type="submit" />
</form> </form>
<input type="button" value="Print" onclick="printMap()" /> <input type="button" id="printbutton" value="Print" onclick="printMap()" />
<h2>Printable High-Resolution Maps!</h2>
<ol>
<li>Search/center/zoom this map until it covers the desired area.</li>
<li>Click the Print button above.</li>
<li>A new window will open with a high-resolution map!</li>
</ol>
<ul id="results"></ul> <ul id="results"></ul>
</div> </div>
@ -54,7 +68,7 @@
var query = ""; var query = "";
var map = L.map('map'); //.setView([51.505, -0.09], 13); var map = L.map('map'); //.setView([51.505, -0.09], 13);
L.tileLayer('http://{s}.tile.cloudmade.com/4be2d4a8b7ae4a5e8ebc0558bb5d7db4/997/256/{z}/{x}/{y}.png', { L.tileLayer('http://{s}.tile.cloudmade.com/4be2d4a8b7ae4a5e8ebc0558bb5d7db4/997/256/{z}/{x}/{y}.png', {
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery &copy; <a href="http://cloudmade.com">CloudMade</a>', attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>; Imagery &copy; <a href="http://cloudmade.com">CloudMade</a>',
maxZoom: 18 maxZoom: 18
}).addTo(map); }).addTo(map);

View File

@ -9,20 +9,26 @@
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
#navigation { #navigation {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; right: 0;
z-index: 999; z-index: 9999;
background-color: white; background-color: white;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
padding: 1em; padding: 1em;
border: 1px solid black; width: 20em;
} overflow-y: auto;
opacity: 0.8;
}
#map { #map {
height: 2550px; /* 8.5 inch at 300 dpi */ height: 2550px; /* 8.5 inch at 300 dpi */
width: 3300px; /* 11 inch at 300 dpi */ width: 3300px; /* 11 inch at 300 dpi */
} }
#printbutton {
font-size: 1.5em;
font-weight: bold;
}
</style> </style>
<style type="text/css" media="print"> <style type="text/css" media="print">
@page { @page {
@ -49,11 +55,17 @@
</head> </head>
<body> <body>
<div id="navigation"> <div id="navigation">
<p>Wait for the (huge!) map to load, then click Print.<br/> <ol>
If it comes out poorly, close this window and try again.</p> <li>Wait for the (huge!) map to load, then click Print.</li>
<li>Check the print preview for missing chunks of map!</li>
<li>If there's some problem, just close this window and try again, or click Refresh.</li>
<li>
<a href="https://github.com/zyphlar/printmaps/issues">Report</a> any unsolvable issues, or
<a href="https://github.com/zyphlar/printmaps">Contribute</a> to make this tool better!
</li>
</ol>
<input type="button" value="Print" id="printbutton" onclick="printMap()" /> <input type="button" value="Print" id="printbutton" onclick="printMap()" />
</div> </div>
<div id="title"></div>
<div id="map"></div> <div id="map"></div>
<script type="text/javascript"> <script type="text/javascript">
@ -70,7 +82,7 @@
var query = decodeURIComponent(params["q"]); var query = decodeURIComponent(params["q"]);
var map = L.map('map', {zoomControl: false}); //.setView([51.505, -0.09], 13); var map = L.map('map', {zoomControl: false}); //.setView([51.505, -0.09], 13);
L.tileLayer('http://{s}.tile.cloudmade.com/4be2d4a8b7ae4a5e8ebc0558bb5d7db4/997/256/{z}/{x}/{y}.png', { L.tileLayer('http://{s}.tile.cloudmade.com/4be2d4a8b7ae4a5e8ebc0558bb5d7db4/997/256/{z}/{x}/{y}.png', {
attribution: query+' map from PrintMaps.com, data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery &copy; <a href="http://cloudmade.com">CloudMade</a>', attribution: query+' map from PrintMaps.com; Data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>; Imagery &copy; <a href="http://cloudmade.com">CloudMade</a>',
maxZoom: 18 maxZoom: 18
}).addTo(map); }).addTo(map);