Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (34 sloc) 1.348 kB
<!DOCTYPE html>
<html>
<head>
<title>Modest Maps JS</title>
<script type="text/javascript" src="../../modestmaps.js"></script>
<script type="text/javascript" src="follower.js"></script>
<script type="text/javascript">
var map;
function initMap() {
var src = document.getElementById('src');
eval(src.textContent || src.innerText);
}
</script>
</head>
<body onload="initMap()">
<h1>Modest Maps JS</h1>
<p><a href="javascript:map.zoomIn()">zoom in</a> | <a href="javascript:map.zoomOut()">zoom out</a>
<br><a href="javascript:map.panLeft()">pan left</a> | <a href="javascript:map.panRight()">pan right</a> | <a href="javascript:map.panDown()">pan down</a> | <a href="javascript:map.panUp()">pan up</a></p>
<div id="map">
</div>
<p>The above div is a map initialized like so:</p>
<pre id="src">
var layer = new MM.Layer(new MM.MapProvider(function(coord) {
var img = parseInt(coord.zoom) +'-r'+ parseInt(coord.row) +'-c'+ parseInt(coord.column) + '.jpg';
return 'http://osm-bayarea.s3.amazonaws.com/' + img;
}));
map = new MM.Map('map', layer, new MM.Point(900,900))
var f = new MM.Follower(map, new MM.Location(37.811530, -122.2666097), '&#xB0; Broadway and Grand');
map.setCenterZoom(new MM.Location(37.811530, -122.2666097), 14);
</pre>
<p>Hands up who wants overlays?</p>
<div id="log"></div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.