Customise Logger Popup Content

It is possible to override the default content displayed in Logger information popups by defining a JavaScript function that is passed the feature collection to display and is expected to return a HTML string which will be displayed in the popup. The function is associated with a layer by specifying the layer name. A example for a layer called "streets" is shown below:

Example
Astun.JS.Logger.formatFunctions['streets'] = function(featureCol) {
    var html = '';
    for (i = 0; i < featureCol.features.length; i++) {
        var feat = featureCol.features[i];
        html += '<div class="at-faultlogger-popup">';
        html += '    <h3>This is a known issue.</h3>';
        html += '    <p><strong>' + feat.properties.fields.description + '</strong></p>';
        html += '    <p>Status: <strong>' + feat.properties.fields.status + '</strong></p>';
        html += '    <p class="meta">' + feat.properties.fields.details + '</p>';
        html += '    <p><a href="TrackProblem.aspx?mapid=' + feat.properties.fields.caseid + '" target="_blank">Track this problem</a></p>';
        html += '</div>';
        // Only display details of the first feature (break stops the loop iteration)
        break;
    }
    return html;
};