src/ol/format/KML.js
function setCommonGeometryProperties(multiGeometry, geometries) {
  const ii = geometries.length;
  const extrudes = new Array(geometries.length);
  const tessellates = new Array(geometries.length);
  const altitudeModes = new Array(geometries.length);
  let hasExtrude, hasTessellate, hasAltitudeMode;
  hasExtrude = hasTessellate = hasAltitudeMode = false;
  for (let i = 0; i < ii; ++i) {
    const geometry = geometries[i];
    extrudes[i] = geometry.get('extrude');
    tessellates[i] = geometry.get('tessellate');
    altitudeModes[i] = geometry.get('altitudeMode');
    hasExtrude = hasExtrude || extrudes[i] !== undefined;
    hasTessellate = hasTessellate || tessellates[i] !== undefined;
    hasAltitudeMode = hasAltitudeMode || altitudeModes[i];
  }
  if (hasExtrude) {
    multiGeometry.set('extrude', extrudes);
  }
  if (hasTessellate) {
    multiGeometry.set('tessellate', tessellates);
  }
  if (hasAltitudeMode) {
    multiGeometry.set('altitudeMode', altitudeModes);
  }
}
function setCommonGeometryProperties(multiGeometry, geometries) {
  const ii = geometries.length;
  const extrudes = new Array(geometries.length);
  const tessellates = new Array(geometries.length);
  const altitudeModes = new Array(geometries.length);
  let hasExtrude, hasTessellate, hasAltitudeMode;
  hasExtrude = hasTessellate = hasAltitudeMode = false;
  for (let i = 0; i < ii; ++i) {
    const geometry = geometries[i];
    extrudes[i] = geometry.get('extrude');
    tessellates[i] = geometry.get('tessellate');
    altitudeModes[i] = geometry.get('altitudeMode');
    hasExtrude = hasExtrude || extrudes[i] !== undefined;
    hasTessellate = hasTessellate || tessellates[i] !== undefined;
    hasAltitudeMode = hasAltitudeMode || altitudeModes[i];
  }
  if (hasExtrude) {
    multiGeometry.set('extrude', extrudes);
  }
  if (hasTessellate) {
    multiGeometry.set('tessellate', tessellates);
  }
  if (hasAltitudeMode) {
    multiGeometry.set('altitudeMode', altitudeModes);
  }
}
function setCommonGeometryProperties ( multiGeometry , geometries ) { const ii = geometries . length ; const extrudes = new Array ( geometries . length ) ; const tessellates = new Array ( geometries . length ) ; const altitudeModes = new Array ( geometries . length ) ; let hasExtrude , hasTessellate , hasAltitudeMode ; hasExtrude = hasTessellate = hasAltitudeMode = false ; for ( let i = 0 ; i < ii ; ++ i ) { const geometry = geometries [ i ] ; extrudes [ i ] = geometry . get ( 'extrude' ) ; tessellates [ i ] = geometry . get ( 'tessellate' ) ; altitudeModes [ i ] = geometry . get ( 'altitudeMode' ) ; hasExtrude = hasExtrude || extrudes [ i ] !== undefined ; hasTessellate = hasTessellate || tessellates [ i ] !== undefined ; hasAltitudeMode = hasAltitudeMode || altitudeModes [ i ] ; } if ( hasExtrude ) { multiGeometry . set ( 'extrude' , extrudes ) ; } if ( hasTessellate ) { multiGeometry . set ( 'tessellate' , tessellates ) ; } if ( hasAltitudeMode ) { multiGeometry . set ( 'altitudeMode' , altitudeModes ) ; } }
Reads an array of geometries and creates arrays for common geometry
properties. Then sets them to the multi geometry.
@param {MultiPoint|MultiLineString|MultiPolygon} multiGeometry A multi-geometry.
@param {Array<import("../geom/Geometry.js").default>} geometries List of geometries.
Reads an array of geometries and creates arrays for common geometry properties . Then sets them to the multi geometry .