Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Leaflet Map with OpenStreetMap Tiles
<!DOCTYPE html>
<title>Leaflet Web Map</title>
<!-- reference to Leaflet CSS -->
<link rel="stylesheet" href="" />
<!-- reference to Leaflet JavaScript -->
<script src=""></script>
<!-- set width and height styles for map -->
#map {
width: 960px;
<!-- place holder for map -->
<div id="map"></div>
// create map object, tell it to live in 'map' div and provide center and zoom option values
var map ='map',{
center: [43.64701, -79.39425],
zoom: 15
// add base map tiles from OpenStreetMap and attribution info to 'map' div
L.tileLayer('http://{s}{z}/{x}/{y}.png', {
attribution: '&copy; <a href="">OpenStreetMap</a> contributors'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment