src/js/app.js
//Build out the infowindow with the various data fields from Foursquare.
Build out the infowindow with the various data fields from Foursquare.
Build out the infowindow with the various data fields from Foursquare .
function populateInfoWindow(marker, infowindow) {
    if(infowindow.marker != marker) {
        infowindow.marker = marker;
        var innerHTML = '<div id="iw-container"><div class="iw-title">';
        if (marker.title) {
            innerHTML += marker.title + '</div>';
        }
        if (marker.address1) {
            innerHTML += '<br>' + marker.address1;
        }
        if (marker.address2) {
            innerHTML += '<br>' + marker.address2;
        }
        if (marker.phone) {
            innerHTML += '<br><strong>' + marker.phone + '</strong>';
        }
        if (marker.url) {
            innerHTML += '<br>Site: ' + marker.url;
        }
        if (marker.checkins) {
            innerHTML += '<hr><strong>FourSquare Checkins: </strong>' + marker.checkins;
        }
        innerHTML += '</div>';
        infowindow.setContent(innerHTML);
        infowindow.open(map, marker);
        infowindow.addListener('closeclick', function() {
        infowindow.setMarker = null;
        });
    }
}
function populateInfoWindow ( marker , infowindow ) { if ( infowindow . marker != marker ) { infowindow . marker = marker ; var innerHTML = '<div id="iw-container"><div class="iw-title">' ; if ( marker . title ) { innerHTML += marker . title + '</div>' ; } if ( marker . address1 ) { innerHTML += '<br>' + marker . address1 ; } if ( marker . address2 ) { innerHTML += '<br>' + marker . address2 ; } if ( marker . phone ) { innerHTML += '<br><strong>' + marker . phone + '</strong>' ; } if ( marker . url ) { innerHTML += '<br>Site: ' + marker . url ; } if ( marker . checkins ) { innerHTML += '<hr><strong>FourSquare Checkins: </strong>' + marker . checkins ; } innerHTML += '</div>' ; infowindow . setContent ( innerHTML ) ; infowindow . open ( map , marker ) ; infowindow . addListener ( 'closeclick' , function ( ) { infowindow . setMarker = null ; } ) ; } }
Build out the infowindow with the various data fields from Foursquare.
Build out the infowindow with the various data fields from Foursquare .
//Style the infowindow //https://codepen.io/Marnoto/pen/xboPmG