Skip to content

Instantly share code, notes, and snippets.

@tnightingale
Created August 23, 2017 18:37
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 tnightingale/6f24d6d9163e1e792e3805151aa7ce7a to your computer and use it in GitHub Desktop.
Save tnightingale/6f24d6d9163e1e792e3805151aa7ce7a to your computer and use it in GitHub Desktop.
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css"
integrity="sha512-M2wvCLH6DSRazYeZRIm1JnYyh22purTM+FDB5CsyxtQJYeKq83arPe5wgbNmcFXGqiSH2XR8dT/fJISVA1r/zQ=="
crossorigin=""/>
<style>
html, body {
margin: 0;
}
#mapid {
height: 100vh;
width: 100vw;
}
</style>
<!-- Make sure you put this AFTER Leaflet's CSS -->
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"
integrity="sha512-lInM/apFSqyy1o6s89K4iQUKg6ppXEgsVxT35HbzUupEVRh2Eu9Wdl4tHj7dZO0s1uvplcYGmt3498TtHq+log=="
crossorigin=""></script>
<div id="mapid"></div>
<script>
var mymap = L.map('mapid').setView([38.471, 34.189], 7);
L.tileLayer('https://api.mapbox.com/styles/v1/affinitybridge/{id}/tiles/256/{z}/{x}/{y}?access_token={accessToken}', {
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>',
maxZoom: 18,
id: 'cj6pcatou2gyv2rqsby47vlw4',
accessToken: 'pk.eyJ1IjoiYWZmaW5pdHlicmlkZ2UiLCJhIjoicW4wNkNXdyJ9.KyFVX7DUqVXDdSOwYnLm5Q'
}).addTo(mymap);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment