Skip to content

Instantly share code, notes, and snippets.

@tstibbs
Created June 14, 2016 12:03
Show Gist options
  • Save tstibbs/f528fe92d0116b1f14255e4b807dd515 to your computer and use it in GitHub Desktop.
Save tstibbs/f528fe92d0116b1f14255e4b807dd515 to your computer and use it in GitHub Desktop.
leaflet control overlay
<!DOCTYPE html>
<html>
<!-- fork of http://leafletjs.com/examples/quick-start-example.html -->
<head>
<title>Leaflet Quick Start Guide Example</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="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
<style>
body {
height: 100%;
width: 100%;
height: 100vh;
width: 100vw;
margin: 0;
}
</style>
</head>
<body>
<div id="mapid" style="width: 100%; height: 100%"></div>
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
<script>
var mymap = L.map('mapid').setView([51.505, -0.09], 13);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw', {
maxZoom: 18,
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 © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.streets'
}).addTo(mymap);
L.control.scale().addTo(mymap);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment