static/scripts.js
// Show info window at marker with content
Show info window at marker with content
Show info window at marker with content
function showInfo(marker, content)
{
    let div = "<div id='info'>";
    if (typeof(content) == "undefined")
    {
        div += "<img alt='loading' src='/static/ajax-loader.gif'/>";
    }
    else
    {
        div += "<ul>";
        var p;
        for (p = 0; p < content.length; p++)
        {
            div += "<li>";
            div += "<a href=" + content[p]["link"] + "title=" + content[p]["title"] + ">" + content[p]["title"] + "</a>";
            div += "</li>";
        }
        div += "</ul>";
    }
    div += "</div>";
    info.setContent(div);
    info.open(map, marker);
}
function showInfo ( marker , content ) { let div = "<div id='info'>" ; if ( typeof ( content ) == "undefined" ) { div += "<img alt='loading' src='/static/ajax-loader.gif'/>" ; } else { div += "<ul>" ; var p ; for ( p = 0 ; p < content . length ; p ++ ) { div += "<li>" ; div += "<a href=" + content [ p ] [ "link" ] + "title=" + content [ p ] [ "title" ] + ">" + content [ p ] [ "title" ] + "</a>" ; div += "</li>" ; } div += "</ul>" ; } div += "</div>" ; info . setContent ( div ) ; info . open ( map , marker ) ; }
Show info window at marker with content
Show info window at marker with content
// Start div // http://www.ajaxload.info/ // creates a list // iterates over each link and title collectively in the returned JSON object containing links and titles to articles, and then appends to the info windows content while creating an unordered list // ends list // End div // Set info window's content // Open info window (if not already open)