mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-18 05:53:05 +00:00
Add BahiaMap surfaces on nuclei list, detail, and geral dashboard with server-side choropleth aggregation, lazy geometry loading (B5 F1), and roadmap plans for A7 F4, B5 F3, and B6 scale debts.
25 lines
787 B
TypeScript
25 lines
787 B
TypeScript
import { feature } from 'topojson-client'
|
|
|
|
import municipalityTopologyJson from '@/lib/geometries/bahia-municipalities.topo.json'
|
|
import type {
|
|
BahiaMunicipalityFeature,
|
|
MunicipalityGeometryModule,
|
|
MunicipalityTopology,
|
|
} from '@/lib/bahiaGeometriesTypes'
|
|
|
|
const topology = municipalityTopologyJson as unknown as MunicipalityTopology
|
|
|
|
const municipalityFeatures = feature(
|
|
topology,
|
|
topology.objects.municipalities,
|
|
).features as BahiaMunicipalityFeature[]
|
|
|
|
const municipalityByCodarea = new Map(
|
|
municipalityFeatures.map((entry) => [entry.properties.codarea, entry]),
|
|
)
|
|
|
|
export const municipalityGeometryModule: MunicipalityGeometryModule = {
|
|
topology,
|
|
features: municipalityFeatures,
|
|
getMunicipalityFeature: (codarea: string) => municipalityByCodarea.get(codarea),
|
|
}
|