Skip to content

Instantly share code, notes, and snippets.

@viniciusmaeda
Last active May 9, 2017 13:54
Show Gist options
  • Save viniciusmaeda/38c573f0ee63954852f4989f97b10d55 to your computer and use it in GitHub Desktop.
Save viniciusmaeda/38c573f0ee63954852f4989f97b10d55 to your computer and use it in GitHub Desktop.
Leaflet Sample - Full Screen

Leaflet Sample

Full Screen

<!DOCTYPE html>
<html>
<head>
<title>Full Screen Leaflet Map</title>
<meta charset="utf-8" />
<!-- include leaflet css -->
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css"/>
<!-- include leaflet js -->
<script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script>
<style>
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
// create the object map and center at lat lon and zoom level
var map = L.map('map', {
center: [-23.58, -46.55],
zoom: 10
});
// footer information
mapLink = '<a href="http://openstreetmap.org">OpenStreetMap</a>';
// add layer to map object
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; ' + mapLink + ' Contributors',
maxZoom: 20,
}).addTo(map);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment