Skip to content

Instantly share code, notes, and snippets.

@jeanphix
Created February 5, 2012 11:38
Show Gist options
  • Save jeanphix/1744909 to your computer and use it in GitHub Desktop.
Save jeanphix/1744909 to your computer and use it in GitHub Desktop.
Leaflet + OSM
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="Leaflet/dist/leaflet.css" type="text/css" />
</head>
<body>
<div id="map-canvas" style="height: 500px; width: 90%; margin: 0 auto;">
</div>
<script type="text/javascript" src="Leaflet/dist/leaflet.js"></script>
<script type="text/javascript">
var osmUrl = 'http://tah.openstreetmap.org/Tiles/tile/{z}/{x}/{y}.png',
attribution = 'Map data &copy; 2011 OpenStreetMap contributors',
osmLayer = new L.TileLayer(osmUrl, {maxZoom: 18, attribution: attribution});
var map = new L.Map('map-canvas');
map.setView(new L.LatLng(51.505, -0.09), 13).addLayer(osmLayer);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment