Last active
September 21, 2018 19:02
-
-
Save wboykinm/4612008 to your computer and use it in GitHub Desktop.
Stamen Toner-Hybrid reference overlay
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet Switching + CartoDB</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
<link rel="stylesheet" href="http://geosprocket.com/assets/leaflet/dist/leaflet.css" /> | |
<!--[if lte IE 8]><link rel="stylesheet" href="http://geosprocket.com/assets/leaflet/dist/leaflet.ie.css" /><![endif]--> | |
<!--<script src="http://geosprocket.com/assets/leaflet/dist/leaflet.js"></script>--> | |
<script src="http://libs.cartocdn.com/cartodb.js/v2/cartodb.js"></script> | |
<style> | |
body { | |
padding: 0; | |
margin: 0; | |
} | |
html, body, #map { | |
height: 100%; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="map"></div> | |
<script> | |
var night = L.tileLayer('http://a.tiles.mapbox.com/v3/landplanner.blackmarble2/{z}/{x}/{y}.png', { | |
maxZoom: 9, | |
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>' | |
}), | |
sat = L.tileLayer('http://a.tiles.mapbox.com/v3/landplanner.map-a0wbwf43/{z}/{x}/{y}.png', { | |
maxZoom: 18, | |
attribution: 'Map data © 2012 <a href="http://nasa.gov">NASA</a>' | |
}), | |
ref1 = L.tileLayer('http://b.tile.stamen.com/toner-hybrid/{z}/{x}/{y}.png', { | |
maxZoom: 19, | |
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>' | |
}), | |
ref2 = L.tileLayer('http://a.tiles.mapbox.com/v3/landplanner.map-6loa9k8g/{z}/{x}/{y}.png', { | |
maxZoom: 19, | |
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 map = L.map('map', { | |
zoomControl: true, | |
center: [24.427013, -79.091309], | |
zoom: 7, | |
layers: [night, ref1] | |
}); | |
var baseLayers = { | |
"Black Marble": night, | |
"Satellite View": sat | |
}; | |
var overlays = { | |
"Stamen Reference": ref1, | |
"Mapbox Reference": ref2 | |
}; | |
L.control.layers(baseLayers, overlays).addTo(map); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment