Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created October 21, 2013 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmcw/7085483 to your computer and use it in GitHub Desktop.
Save tmcw/7085483 to your computer and use it in GitHub Desktop.
var map = L.mapbox.map('map', 'kalipso.map-aa48b9v7').setView([61.573408, 98.446449], 4);
var myMarkers = L.mapbox.markerLayer().addTo(map);
myMarkers.on('layeradd', function(e) {
var marker = e.layer,
feature = marker.feature;
var popupContent = '<p><strong><img src="' + feature.properties.logo + '" class="map_logo"/>' + feature.properties.title + '</strong><br />' + feature.properties.description + '</p>' + '<img src="' + feature.properties.image + '">';
marker.bindPopup(popupContent,{
closeButton: false,
minWidth: 320
});
marker.setIcon(L.icon(feature.properties.icon));
});
myMarkers.loadURL('example.geojson');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment