Skip to content

Instantly share code, notes, and snippets.

@wjramos
Created May 21, 2014 18:05
Show Gist options
  • Save wjramos/fe5691574e17062aeaa7 to your computer and use it in GitHub Desktop.
Save wjramos/fe5691574e17062aeaa7 to your computer and use it in GitHub Desktop.
Leaflet map external info pane
// Bind a popup to each icon based on the same properties
marker.bindPopup('<strong>' + marker.toGeoJSON().properties.title + '</strong>' + '</br>' + marker.toGeoJSON().properties.Description);
//Info Pane Content
marker.on('click', function(e) {
// Force the popup closed.
// e.layer.closePopup();
infopane.className = 'fill-lighten3 offcanvas-right animate pin-right keyline-left active';
// var feature = e.layer.feature;
var info = '<h2 class="center">' + marker.toGeoJSON().properties.title + '</h2>' + '</br>' + '<h3>' + marker.toGeoJSON().properties.Estate + '</h3>' + '<h4>Industry: ' + marker.toGeoJSON().properties.Industry + '</h4>' + '</br>' + '<strong>Latitude: </strong>' + e.latlng.lat + '</br>' + '<strong>Longitude: </strong>' + e.latlng.lng + '</br><p>' + marker.toGeoJSON().properties.Description + '</p>';
//feature.getLatLng()
document.getElementById('info').innerHTML = info;
});
@wjramos
Copy link
Author

wjramos commented May 21, 2014

Classes are from MapBox Base css framework

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment