Skip to content

Instantly share code, notes, and snippets.

@jfirebaugh
Created February 28, 2013 23:14
Show Gist options
  • Select an option

  • Save jfirebaugh/5060992 to your computer and use it in GitHub Desktop.

Select an option

Save jfirebaugh/5060992 to your computer and use it in GitHub Desktop.
Leaflet/mapbox opacity test
<link rel="stylesheet" href="dist/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="dist/leaflet.ie.css" />
<![endif]-->
<script src="dist/leaflet.js"></script>
<style>
#map {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
}
</style>
<div id="map"></div>
<script>
var map = L.map('map')
.setView([43.6654, -79.4775], 15);
var base = L.tileLayer('http://{s}.tile.mapbox.com/v3/examples.map-vyofok3q/{z}/{x}/{y}.png')
.addTo(map);
var overlay = L.tileLayer('http://{s}.tile.mapbox.com/v3/aibram.Aerial/{z}/{x}/{y}.png')
.addTo(map);
overlay.setOpacity(0.6);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment