Skip to content

Instantly share code, notes, and snippets.

@vschmidt94
Created November 14, 2014 20:30
Show Gist options
  • Select an option

  • Save vschmidt94/4f1e97dd1860bcdab14a to your computer and use it in GitHub Desktop.

Select an option

Save vschmidt94/4f1e97dd1860bcdab14a to your computer and use it in GitHub Desktop.
JS File to add Leaflet Map to HTML div
var map1 = L.map('map1').setView([44.55957, -123.28141355887], 13);
L.tileLayer('http://{s}.tiles.mapbox.com/v3/YOUR_MAP_ID_HERE/{z}/{x}/{y}.png',
{
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
}).addTo(map1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment