feat: revamp demo

This commit is contained in:
Justineo
2025-09-24 01:27:35 +08:00
committed by GU Yiling
parent 1da2bf7811
commit def0ad5bf5
47 changed files with 4180 additions and 1740 deletions

16
demo/utils/geo.ts Normal file
View File

@ -0,0 +1,16 @@
import type { registerMap } from "echarts/core";
type GeoJSONInput = Parameters<typeof registerMap>[1];
type FeatureCollectionLike = { type?: unknown };
export function isGeoJSONSource(value: unknown): value is GeoJSONInput {
if (typeof value === "string") {
return true;
}
if (value && typeof value === "object" && "type" in value) {
const type = (value as FeatureCollectionLike).type;
return type === "FeatureCollection";
}
return false;
}