src/mmw/js/src/core/vizerLayers.js
/* Update an existing popup with model values merged with a single measurement
 * result for each category (variable) available in the asset */
Update an existing popup with model values merged with a single measurement
result for each category (variable) available in the asset
Update an existing popup with model values merged with a single measurement result for each category ( variable ) available in the asset
function updatePopup(popup, model, recentValues) {
    var values = _.map(model.get('measurements'), function(category) {
        var measurement = _.find(recentValues.result, {var_id: category.var_id});
        if (measurement) {
            measurement.lastUpdated = new Date(measurement.time * 1000); 
        }
        return _.extend(category, measurement);
    });
    model.set('measurements', values);
    var view = new ObservationPopupView({model: model});
    popup.setContent(view.render().el);
    popup.update();
}
function updatePopup ( popup , model , recentValues ) { var values = _ . map ( model . get ( 'measurements' ) , function ( category ) { var measurement = _ . find ( recentValues . result , { var_id : category . var_id } ) ; if ( measurement ) { measurement . lastUpdated = new Date ( measurement . time * 1000 ) ; } return _ . extend ( category , measurement ) ; } ) ; model . set ( 'measurements' , values ) ; var view = new ObservationPopupView ( { model : model } ) ; popup . setContent ( view . render ( ) . el ) ; popup . update ( ) ; }
Update an existing popup with model values merged with a single measurement
 result for each category (variable) available in the asset
Update an existing popup with model values merged with a single measurement result for each category ( variable ) available in the asset
// seconds -> ms