src/mmw/js/src/core/utils.js
// Convert polygon to MultiPolyon (mutates original argument).
Convert polygon to MultiPolyon (mutates original argument).
Convert polygon to MultiPolyon ( mutates original argument ) .
function toMultiPolygon(polygon) {
        var geom = polygon.geometry ? polygon.geometry : polygon;
        if (geom.type !== 'MultiPolygon') {
            if (geom.type === 'Polygon') {
                geom.coordinates = [geom.coordinates];
            } else if (geom.type === 'FeatureCollection') {
                return toMultiPolygon(geom.features[0]);
            }
            geom.type = 'MultiPolygon';
        }
        return geom;
    }
function toMultiPolygon ( polygon ) { var geom = polygon . geometry ? polygon . geometry : polygon ; if ( geom . type !== 'MultiPolygon' ) { if ( geom . type === 'Polygon' ) { geom . coordinates = [ geom . coordinates ] ; } else if ( geom . type === 'FeatureCollection' ) { return toMultiPolygon ( geom . features [ 0 ] ) ; } geom . type = 'MultiPolygon' ; } return geom ; }
Convert polygon to MultiPolyon (mutates original argument).
Convert polygon to MultiPolyon ( mutates original argument ) .