Playing with Mapbox and bl.ocks.org.
Created
November 30, 2012 18:46
-
-
Save aliou/4177676 to your computer and use it in GitHub Desktop.
A mapbox test
This file contains hidden or 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
*.json |
This file contains hidden or 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.6/mapbox.js'></script> | |
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/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 src='map.js'></script> | |
</body> | |
</html> |
This file contains hidden or 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
var map = mapbox.map('map'); | |
map.addLayer(mapbox.layer().id('aliou.map-5150vxq1')); | |
var markerLayer = mapbox.markers.layer(); | |
mapbox.markers.interaction(markerLayer); | |
map.addLayer(markerLayer); | |
map.centerzoom({ lat: 48.854722, lon: 2.345833 }, 8); | |
markerLayer.features([ | |
{ | |
geometry: { | |
coordinates: [2.345833, 48.854722] | |
}, | |
properties: { | |
'marker-color': '#000', | |
'marker-symbol': 'star-stroked', | |
title: 'Point A', | |
description: '' | |
} | |
}, { | |
geometry: { | |
coordinates: [4.345833, 48.854722] | |
}, | |
properties: { | |
'marker-color': '#000', | |
'marker-symbol': 'star-stroked', | |
title: 'Point B', | |
description: '' | |
} | |
} | |
]); | |
map.ui.attribution.add() | |
.content('<a href="http://mapbox.com/about/maps">Terms & Feedback</a>'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment