Skip to content

Instantly share code, notes, and snippets.

@rabernat
Forked from tristen/app.js
Created February 10, 2014 17:07
Show Gist options
  • Save rabernat/8920024 to your computer and use it in GitHub Desktop.
Save rabernat/8920024 to your computer and use it in GitHub Desktop.
var initMap = function() {
var template = 'http://{S}tile.openstreetmap.org/{Z}/{X}/{Y}.png';
var subdomains = ['', 'a.', 'b.', 'c.'];
var provider = new MM.TemplatedLayer(template, subdomains);
var map = new MM.Map('map', provider, null, [
new MM.MouseWheelHandler(null, true)
]);
map.setCenterZoom(new MM.Location(37.811530, -122.2666097), 9);
}
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Modest Maps JS Demo | Any Zoom</title>
<link rel='stylesheet' href='style.css'>
</head>
<body onload='initMap()'>
<div id='map' />
<script src='https://rawgithub.com/stamen/modestmaps-js/master/modestmaps.min.js'></script>
<script src='app.js'></script>
</body>
</html>
body {
font: 13px/22px 'Helvetica Neue', Helvetica, sans;
margin: 0;
padding: 0;
}
#map {
position: absolute;
top: 0; left: 0;
width: 100%;
height: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment