Skip to content

Commit

Permalink
update chapter popup
Browse files Browse the repository at this point in the history
  • Loading branch information
geobrando committed Jun 25, 2015
1 parent 91bc87b commit 0d0cc53
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions js/chapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ $(function() {

var chapterMarkers = L.geoJson( data, {
onEachFeature: function (feature, layer) {
var popupOptions = {'maxWidth' : '1000'};
var popupContent = '<h2>'+ feature.properties.title +'</h2>' + 'Twitter: ' +
'<a href="http://twitter.com/' + feature.properties.twitter + '" target="_blank">@' + feature.properties.twitter +'</a>';
var popupOptions = {'maxWidth' : '1000'};
var popupContent = '<h2>'+ feature.properties.title +'</h2>';
if (feature.properties.location && feature.properties.location.length > 0) {
popupContent = popupContent + '<h3>'+ feature.properties.location +'</h3>';
}
if (feature.properties.twitter && feature.properties.twitter.length > 0) {
popupContent = popupContent + 'Twitter: ' + '<a href="http://twitter.com/' +
feature.properties.twitter + '" target="_blank">@' + feature.properties.twitter +'</a>';
}
layer.bindPopup(popupContent,popupOptions);
layer.setIcon(new L.Icon({
iconUrl:'/img/maptime-marker.png',
Expand Down

0 comments on commit 0d0cc53

Please sign in to comment.