Created
January 29, 2013 19:25
-
-
Save tmcw/4666894 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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' /> | |
<style> | |
body { margin:0; padding:0; } | |
#map { position:absolute; top:0; bottom:0; width:100%; } | |
.marker-image { | |
width:100px; | |
height:100px; | |
border:1px solid #000; | |
margin-left:-51px; | |
margin-top:-51px; | |
pointer-events:all; | |
position:absolute; | |
} | |
</style> | |
</head> | |
<body> | |
<div id='map'></div> | |
<script> | |
// Create map | |
mapbox.auto('map', 'examples.map-zr0njcqy', function(map, tiledata) { | |
// Replace marker factory function with our version | |
tiledata.markers.factory(function(m) { | |
// Create a marker using the simplestyle factory | |
var img = document.createElement('img'); | |
img.className = 'marker-image'; | |
img.setAttribute('src', "http://www.dummyimage.com/100x100/bd00bd/fff"); | |
return img; | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment