Skip to content

Instantly share code, notes, and snippets.

@nighto
Last active March 18, 2016 16:47
Show Gist options
  • Save nighto/0007ee86b10d5857f549 to your computer and use it in GitHub Desktop.
Save nighto/0007ee86b10d5857f549 to your computer and use it in GitHub Desktop.
Leaflet - first step
var initialCoordinates = [-22.91, -43.20]; // Rio de Janeiro
var initialZoomLevel = 13;
// create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map').setView(initialCoordinates, initialZoomLevel);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; Contribuidores do <a href="http://osm.org/copyright">OpenStreetMap</a>'
}).addTo(map);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment