Last active
December 18, 2015 15:49
-
-
Save oeon/5806713 to your computer and use it in GitHub Desktop.
PirateBox, OpenStreetMap/Leaflet html http://forum.daviddarts.com/read.php?2,6988
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Source code by Gaël Musquet aka RatZillaS under WTFPL licence [http://www.wtfpl.net/] --> | |
<html> | |
<head> | |
<title>Embed OpenStreetMap on your PirateBox</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
<link rel="stylesheet" href="OpenPirateMap/leaflet/dist/leaflet.css" /> | |
<script type="text/javascript" src="OpenPirateMap/leaflet/dist/leaflet.js"></script> | |
<style> | |
body { | |
padding: 0; | |
margin: 0; | |
} | |
html, body, #map { | |
height: 100%; | |
} | |
</style> | |
</head> | |
<body> | |
<!-- Size of the map in pixel--> | |
<div id="map"></div> | |
<!-- Start of the leaflet javascript script--> | |
<script> | |
// Path name of tiles | |
var topo = L.tileLayer('http://piratebox.lan/Shared/OpenPirateMap/tiles_topo/{z}/{x}/{y}.png', { tms:false, | |
//MaxZoom | |
maxZoom: 14, | |
//MinZoom | |
minZoom: 10, | |
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>' | |
}); | |
var osm = L.tileLayer('http://piratebox.lan/Shared/OpenPirateMap/tiles_osm/{z}/{x}/{y}.png', { tms:false, | |
//MaxZoom | |
maxZoom: 14, | |
//MinZoom | |
minZoom: 10, | |
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>' | |
}); | |
// Set center of the map and default zoom | |
var map = L.map('map', { | |
center: new L.LatLng(35.23, -120.65), | |
zoom: 12, | |
layers: [topo, osm] | |
}); | |
var baseMaps = { | |
"Topo": topo, | |
"OSM - MapQuest": osm | |
}; | |
L.control.layers(baseMaps, null).addTo(map); | |
</script> | |
<!-- End of the leaflet javascript script--> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I renamed
osm_onboard
folder toOpenPirateMap
. I also renamed/movedOSM_In_A_Box_beta.html
tomaptiles_offline.html
and moved it up on level. Enabled layer switcher and mobile layout.