io module
函數
函式詳細資料
read(string | ArrayBuffer | Blob, SpatialDataReadOptions)
接受空間資料字串或檔案或壓縮檔案的 URL,並將空間資料剖析為 GeoJSON 物件。 支援的空間資料格式:KML、KMZ、GPX、GeoRSS、GML、空間分隔檔案 (CSV) 、GeoJSON。
function read(spatialData: string | ArrayBuffer | Blob, options?: SpatialDataReadOptions): Promise<SpatialDataSet>
參數
- spatialData
-
string | ArrayBuffer | Blob
要讀取之檔案的空間資料字串或 URL。
- options
- SpatialDataReadOptions
讀取選項。
傳回
Promise<SpatialDataSet>
write(azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet | Array<azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet>, SpatialXmlWriteOptions & GmlWriteOptions & SpatialCsvWriteOptions)
以指定的格式,將 GeoJSON 物件資料寫入為地理空間 XML 字串。
function write(data: azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet | Array<azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet>, options?: SpatialXmlWriteOptions & GmlWriteOptions & SpatialCsvWriteOptions): Promise<string>
參數
- data
-
azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet | Array<azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet>
要從中擷取圖形的 GeoJSON 物件,要寫入。
自訂 XML 撰寫方式的一組選項。
傳回
Promise<string>
writeCompressed(azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet | Array<azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet>, "Base64" | "Blob" | "ArrayBuffer", SpatialXmlWriteOptions & GmlWriteOptions & SpatialCsvWriteOptions)
將 GeoJSON 物件資料寫入至內嵌在壓縮檔案中的地理空間 XML 檔案。 zip 檔案中的空間檔案會是名稱 'doc',並指派適當的副檔名。 可能的副檔名包括;xml, kml, json, csv, tsv, txt.
function writeCompressed(data: azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet | Array<azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet>, compressFormat?: "Base64" | "Blob" | "ArrayBuffer", options?: SpatialXmlWriteOptions & GmlWriteOptions & SpatialCsvWriteOptions): Promise<string | ArrayBuffer | Blob>
參數
- data
-
azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet | Array<azmaps.source.DataSource | azmaps.data.FeatureCollection | azmaps.layer.ImageLayer | OgcMapLayer | azmaps.data.Feature<azmaps.data.Geometry, any> | SpatialDataSet>
要從中擷取圖形的 GeoJSON 物件,要寫入。
- compressFormat
-
"Base64" | "Blob" | "ArrayBuffer"
要使用的壓縮檔案格式。 選項:Base64 (資料 URI) 、Blob 或 ArrayBuffer
一組選項,可自訂資料的寫入方式。
傳回
Promise<string | ArrayBuffer | Blob>