export function getFeatureCoordinates()

in modules/react-map-gl-draw/src/edit-modes/utils.ts [92:101]


export function getFeatureCoordinates(feature: Feature) {
  const coordinates = feature && feature.geometry && feature.geometry.coordinates;
  if (!coordinates) {
    return null;
  }

  const isPolygonal = feature.geometry.type === GEOJSON_TYPE.POLYGON;
  const isSinglePoint = feature.geometry.type === GEOJSON_TYPE.POINT;
  return isPolygonal ? coordinates[0] : isSinglePoint ? [coordinates] : coordinates;
}