UNPKG

@fusedashlabs/ui9000-workspace

Version:

UI9000 workspace MCP. One tool, show_workspace, draws a chart from your table. Set TYPESAFE_API_KEY to let Jev choose the chart.

30 lines (29 loc) • 1.1 kB
import { GEOJSON_KEYS } from "./geojsonKeys.js"; export const getRegionIdFromFeatureProperties = (featureProperties, mapType) => { if (!featureProperties || !mapType) { return undefined; } switch (mapType) { case "city": return featureProperties?.[GEOJSON_KEYS.city.id]; case "region": return featureProperties?.[GEOJSON_KEYS.region.id]; case "county": return featureProperties?.[GEOJSON_KEYS.county.id]; case "state": return featureProperties?.[GEOJSON_KEYS.state.id]; case "province": return featureProperties?.[GEOJSON_KEYS.province.id]; case "country": { const iso = featureProperties?.[GEOJSON_KEYS.country.id]; // NE marks disputed territories (Kosovo, Somaliland, N. Cyprus, ...) // with iso_a3="-99"; their stable id lives in adm0_a3. if (iso === "-99") { return featureProperties?.adm0_a3 ?? iso; } return iso; } default: return undefined; } };