Skip to content

Instantly share code, notes, and snippets.

@pe3
Last active December 19, 2015 06:29
Show Gist options
  • Save pe3/5912237 to your computer and use it in GitHub Desktop.
Save pe3/5912237 to your computer and use it in GitHub Desktop.
Show OpenStreetMap with Leaflet
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Test</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
<style type="text/css">
#map { height: 180px; }
</style>
</head>
<body>
<div id="map"></div>
<script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
<script>
// create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map').setView([60.188361, 24.956667], 17);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
</script>
<a href="http://bl.ocks.org/pe3/5912237">esimerkki bl.ocks:issa</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment