Skip to content

Instantly share code, notes, and snippets.

@aliou
Created November 30, 2012 18:46
Show Gist options
  • Save aliou/4177676 to your computer and use it in GitHub Desktop.
Save aliou/4177676 to your computer and use it in GitHub Desktop.
A mapbox test
<!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>
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 &amp; Feedback</a>');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment