Skip to content

Instantly share code, notes, and snippets.

@filipkral
Last active September 11, 2015 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filipkral/730b1b75b53facad03d9 to your computer and use it in GitHub Desktop.
Save filipkral/730b1b75b53facad03d9 to your computer and use it in GitHub Desktop.
Minimal Leaflet Map
<!DOCTYPE html>
<html>
<head>
<title>Minimal Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
<style>
#map{
width: 150px;
height:250px;
}
</style>
<script src="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
<script src="//cdn.jsdelivr.net/leaflet.esri/1.0.0/esri-leaflet.js"></script>
</head>
<body>
<div id="map"></div>
<script>
var makeOverviewMap = function(id, options){
var map = L.map(id, {
dragging: false,
touchZoom: false,
scrollWheelZoom: false,
doubleClickZoom: false,
boxZoom: false,
tap: false,
keyboard: false,
zoomControl: false,
attributionControl: false
})
.setView([55.5, -4.3], 4);
L.esri.basemapLayer('Gray').addTo(map);
L.marker([51.5, -0.09]).addTo(map);
return map;
}
makeOverviewMap('map');
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Minimal Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
<style>
#map{
width: 300px;
height:500px;
}
</style>
<script src="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map('map').setView([55.505, -4.3], 5);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OSM</a>'
}).addTo(map);
L.marker([51.5, -0.09]).addTo(map)
//.bindPopup('A pretty CSS3 popup.<br> Easily customizable.')
//.openPopup()
;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment