satupeta-main/app/(modules)/maps/utils/feature-information.ts
2026-01-27 09:31:12 +07:00

24 lines
551 B
TypeScript

interface GeoJsonFeature {
type: string;
geometry: {
type: string;
coordinates: number[];
};
properties: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
[key: string]: any;
};
}
const extractFeatureInformation = (FeaturesInfo: [], layerType: string) => {
if (layerType === "wms") {
return FeaturesInfo.map((feature: GeoJsonFeature) => ({
id: feature.properties.id,
name: feature.properties.name,
properties: feature.properties,
}));
}
};
export { extractFeatureInformation };