Skip to content

Instantly share code, notes, and snippets.

@maptastik maptastik/index.html

Last active Aug 29, 2015
What would you like to do?
Leaflet Squirrel - Step 1
  1. Add Leaflet starter code (4-5)
  2. Specify the center lat/long of our starting view (16)
  3. Add our tile layer URL from MapStack
  • Here's the long URL from Mapstack we're using to call our tiles (19-25): http://{s},$fff[difference],$fff[@60],$fff[hsl-saturation@90])[multiply],(mapbox-water,$fff[difference],$000[@60],$090d11[hsl-color]))/{z}/{x}/{y}.png
<title>Leaflet Squirrel - Step 1</title>
<link rel="stylesheet" href=""/>
<script src=""></script>
#map{ height: 100% }
<div id="map"></div>
// initialize the map centered on the geographic center of the lower 48
var map ='map').setView([39.833, -98.35], 4);
// load tile layer from mapstack we copied earlier and use the required attribution
'http://{s},$fff[difference],$fff[@60],$fff[hsl-saturation@90])[multiply],(mapbox-water,$fff[difference],$000[@60],$090d11[hsl-color]))/{z}/{x}/{y}.png', {
attribution: 'Map tiles by <a href=””>Stamen Design</a>, under <a href=””>CC BY 3.0</a>. Data by <a href=””>OpenStreetMap</a>, under <a href=””>CC BY SA</a>',
// we want to limit the scrollability
maxZoom: 19,
minZoom: 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.