js-src/aggregate.jsm
/**
 * Add the given geojson to the given map, and do some clean-up. Geojson 
 * should be in WGS84 projection already.
 * @param geojson 
 * @param map 
 */
Add the given geojson to the given map, and do some clean-up. Geojson
should be in WGS84 projection already.
@param geojson
@param map
Add the given geojson to the given map and do some clean - up . Geojson should be in WGS84 projection already . @param geojson @param map
function addGeojsonToMap(geojson, map) {
    window.geojson = geojson; 
    document.querySelector('#intro-explainer').classList.add('hidden')
    for (let popup of document.getElementsByClassName('mapboxgl-popup')) {
        popup.remove()
    }
    map.getSource('user-geo').setData(geojson)
    let bb = bboxWithFallback(geojson)
    if (bb && bb.length && bb.length > 0 && isFinite(bb[0])) {
        map.fitBounds(bb, FIT_BOUNDS_OPTIONS)
        updateDetailsForm(geojson)
    }
}
function addGeojsonToMap ( geojson , map ) { window . geojson = geojson ; document . querySelector ( '#intro-explainer' ) . classList . add ( 'hidden' ) for ( let popup of document . getElementsByClassName ( 'mapboxgl-popup' ) ) { popup . remove ( ) } map . getSource ( 'user-geo' ) . setData ( geojson ) let bb = bboxWithFallback ( geojson ) if ( bb && bb . length && bb . length > 0 && isFinite ( bb [ 0 ] ) ) { map . fitBounds ( bb , FIT_BOUNDS_OPTIONS ) updateDetailsForm ( geojson ) } }
Add the given geojson to the given map, and do some clean-up.
Add the given geojson to the given map and do some clean - up .
// we'll need to get at it later to upload, etc // if we add empty geojson the bbox is infinite