跳到主要内容

GeoJSONLayer API

GeoJSON 图层 API 文档。

完整的 GeoJSONLayer 使用指南请参考 GeoJSON 图层

构造函数

constructor(id: string, options?: GeoJSONLayerOptions)

配置选项

interface GeoJSONLayerOptions {
url?: string;
data?: GeoJSON.FeatureCollection | GeoJSON.Feature;
style?: VectorStyle;
}

方法

loadFromURL()

从 URL 加载 GeoJSON 数据。

loadFromURL(): Promise<void>

setGeoJSON()

设置 GeoJSON 数据。

setGeoJSON(data: GeoJSON.FeatureCollection | GeoJSON.Feature): void

查看 GeoJSON 图层文档 了解详细用法。