Permalink
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (33 sloc) 1.3 KB
<html>
<head>
<title>Modest Maps JS</title>
<!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
<script type="text/javascript" src="../../modestmaps.js"></script>
<script type="text/javascript" src="follower-canvas.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">
// "import" the namespace
var mm = com.modestmaps;
var layer = new mm.TemplatedLayer('http://osm-bayarea.s3.amazonaws.com/{Z}-r{Y}-c{X}.jpg');
map = new mm.Map('map', layer, new mm.Point(1024,768))
var f = new mm.Follower(map, new mm.Location(37.811530, -122.2666097), '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>