Skip to content

A spy satellite simulator in your browser, except the data is real. Live open source spatial intelligence on a photorealistic 3D globe.

574 B
Raw Blame
/** Semantic candidate operations supplied to search and annotation selection. */
export const FEATURE_SOURCE_METHODS = Object.freeze([
  'getAdministrativeAreas',
  'getAreaGeometry',
  'getNeighborhoodAreas',
  'getStreetAreas',
  'getStreetLines',
  'getFootprints',
  'getEnclosingAreas',
  'getMonuments',
  'getFocusFootprints',
]);

export function requireFeatureSource(source) {
  for (const method of FEATURE_SOURCE_METHODS) {
    if (typeof source?.[method] !== 'function')
      throw new TypeError('Missing feature operation: ' + method);
  }
  return source;
}