Created
May 26, 2015 00:27
-
-
Save BaconSoap/622ce0b7b6da8fade5fb to your computer and use it in GitHub Desktop.
blog-leaflet-mapping: iteration 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var map; | |
function init() { | |
// create a new map with no base layer | |
map = new L.Map("map", { | |
center: new L.LatLng(42.3964631, -71.1205171), | |
zoom: 16 | |
}); | |
// use Stamen's 'terrain' base layer | |
var layer = new L.StamenTileLayer("terrain"); | |
map.addLayer(layer); | |
} | |
document.addEventListener('DOMContentLoaded', init); | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Leaflet Map</title> | |
</head> | |
<body> | |
<div id="map"></div> | |
<script src="/bower_components/leaflet/dist/leaflet.js"></script> | |
<link rel="stylesheet" href="/bower_components/leaflet/dist/leaflet.css"> | |
<style type="text/css"> | |
#map { | |
width: 1280px; | |
height: 720px; | |
} | |
</style> | |
<script src="/bower_components/tile.stamen/index.js"></script> | |
<script src="src/app.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment