Skip to content

Instantly share code, notes, and snippets.

@tsamaya
Last active November 30, 2015 14:38
Show Gist options
  • Save tsamaya/6dda3772b1fbd9a3ba10 to your computer and use it in GitHub Desktop.
Save tsamaya/6dda3772b1fbd9a3ba10 to your computer and use it in GitHub Desktop.
leaflet introduction - demo 1
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<style type="text/css">
body {
padding: 0;
margin: 0;
}
#map { height: 350px; }
html, body {
height: 100%;
}
</style>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
</head>
<body>
<div id="map"></div>
<script src="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
<script>
var map = L.map('map').setView([45.18478, 5.73134], 13);
L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
maxZoom: 15,
attribution: 'Map data: &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
}).addTo(map);
L.marker([45.18478, 5.73134]).addTo(map)
.bindPopup('Coworking in Grenoble.')
.openPopup();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment