<div id='map'></div>
<script>
var map = mapbox.map('map');
map.addLayer(mapbox.layer().id('examples.map-20v6611k'));
// Create an empty markers layer
var markerLayer = mapbox.markers.layer();
// Add interaction to this marker layer. This
// binds tooltips to each marker that has title
// and description defined.
mapbox.markers.interaction(markerLayer);
map.addLayer(markerLayer);
map.zoom(5).center({ lat: 37, lon: -77 });
// Add a single feature to the markers layer.
// You can use .features() to add multiple features.
markerLayer.add_feature({
geometry: {
// The order of coordinates here is lon, lat. This is because
// we use the GeoJSON specification for all marker features.
// (lon, lat is also the internal order of KML and other geographic formats)
coordinates: [-77, 37.9]
},
properties: {
// these properties customize the look of the marker
// see the simplestyle-spec for a full reference:
// https://github.com/mapbox/simplestyle-spec
'marker-color': '#000',
'marker-symbol': 'star-stroked',
title: 'Example Marker',
description: 'This is a single marker.'
}
});
// Attribute map
map.ui.attribution.add()
.content('<a href="http://mapbox.com/about/maps">Terms & Feedback</a>');
</script>