Skip to content

Instantly share code, notes, and snippets.

@lxbarth
Created August 12, 2015 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lxbarth/b7fea92f16b5ba0dd65a to your computer and use it in GitHub Desktop.
Save lxbarth/b7fea92f16b5ba0dd65a to your computer and use it in GitHub Desktop.
Vanilla leaflet
<html>
<head>
<title>Leaflet Quick Start Guide Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://leafletjs.com/dist/leaflet.css">
<style>
#map {
position: absolute;
left: 0; right: 0; top: 0; bottom: 0;
}
</style
</head>
<body quick-markup_injected="true" class="">
<div id="map"></div>
<script src="http://leafletjs.com/dist/leaflet.js"></script>
<script>
var map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6IjZjNmRjNzk3ZmE2MTcwOTEwMGY0MzU3YjUzOWFmNWZhIn0.Y8bhBaUMqFiPrDRW9hieoQ', {
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(map);
</script>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment