Skip to content

Instantly share code, notes, and snippets.

@tokumine
Created January 8, 2013 17:11
Show Gist options
  • Save tokumine/4485687 to your computer and use it in GitHub Desktop.
Save tokumine/4485687 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; right:0; left:300px; }
a { display:block; }
</style>
</head>
<body>
<div id='map'></div>
<script>
// Create map from http://mapbox.com/mapbox.js/example/custom-marker-tooltip/
var map = mapbox.map('map');
map.addLayer(mapbox.layer().id('skorasaurus.cpsscav2012'));
map.zoom(15).center({ lat: 41.5010, lon: -81.6922 });
map.setZoomRange(15, 19);
$.getJSON('data.json',function(features){
// Create and add marker layer
var markerLayer = mapbox.markers.layer().features(features.features);
var interaction = mapbox.markers.interaction(markerLayer);
map.addLayer(markerLayer);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment