Skip to content

Instantly share code, notes, and snippets.

@robcowie
Created January 26, 2015 10:58
Show Gist options
  • Save robcowie/f2966998641b375124f3 to your computer and use it in GitHub Desktop.
Save robcowie/f2966998641b375124f3 to your computer and use it in GitHub Desktop.
Minimal leafletjs map
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<!-- <script src="http://maps.stamen.com/js/tile.stamen.js?v1.3.0"></script> -->
<style>
#map { height: 450px; }
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = L.map('map', {
minZoom: 2,
maxZoom: 2,
zoomControl: false,
dragging: false,
touchZoom: false,
scrollWheelZoom: false,
doubleClickZoom: false,
boxZoom: false,
keyboard: false
}).setView([51.505, -0.09], 2);
// Mapbox tiles
L.tileLayer('https://a.tiles.mapbox.com/v3/mapbox.world-bright/{z}/{x}/{y}.png', {}).addTo(map);
// Openstreetmap tiles
// L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {}).addTo(map);
// maps.stamen.com tiles
// var layer = new L.StamenTileLayer("watercolor");
// map.addLayer(layer);
var marker = L.marker([51.5, -0.09]).addTo(map);
</script>
<ul>
<li><a href="http://leafletjs.com">Leafletjs</a></li>
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment