satupeta-main/app/(modules)/maps/utils/feature-information.ts

24 lines
551 B
TypeScript
Raw Normal View History

2026-01-27 02:31:12 +00:00
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 };