-
-
Save corylanou/5238771 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='https://dnv9my2eseobd.cloudfront.net/mapbox.js/v0.6.4/mapbox.js'></script> | |
<link href='https://dnv9my2eseobd.cloudfront.net/mapbox.js/v0.6.4/mapbox.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } | |
#map { position:absolute; top:0; bottom:0; width:100%; } | |
</style> | |
</head> | |
<body> | |
<div id='map'></div> | |
<script> | |
var public_url = /http:\/\/\w.tiles.mapbox.com\/v3\//; | |
mapbox.MAPBOX_URL = 'https://dnv9my2eseobd.cloudfront.net/v3/'; | |
mapbox.markers.marker_baseurl = 'https://dnv9my2eseobd.cloudfront.net/v3/marker/'; | |
var tj = wax.tilejson; | |
wax.tilejson = function(u, c) { | |
tj(u, function(x) { | |
for (var i in x) { | |
if (typeof x[i] === 'string') x[i] = x[i].replace(public_url, mapbox.MAPBOX_URL); | |
if (typeof x[i] === 'object') { | |
for (var j in x[i]) { | |
if (typeof x[i][j] === 'string') x[i][j] = x[i][j].replace(public_url, mapbox.MAPBOX_URL); | |
} | |
} | |
} | |
c(x); | |
}); | |
}; | |
mapbox.auto('map', 'examples.map-vyofok3q', function(map) { | |
map.addLayer(mapbox.markers.layer().add_feature({ | |
geometry: { | |
coordinates: [-77, 37.9] | |
}, | |
properties: { | |
'marker-color': '#000', | |
'marker-symbol': 'star-stroked', | |
title: 'Example Marker', | |
description: 'This is a single marker.' | |
} | |
})); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment