Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

41 lines (36 sloc) 1.464 kB
<html>
<head>
<title>Modest Maps JS</title>
<!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
<script type="text/javascript" src="../../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 provider = 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', provider, 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>
Jump to Line
Something went wrong with that request. Please try again.