【发布时间】:2019-07-12 08:49:56
【问题描述】:
Opanlayers 当前版本有 layer 和 source 对象来查看矢量或平铺图像。
图层类型:图像、平铺和矢量
来源类型: ImageWMS、TileWMS、Geojson、OSM、Raster、Vector……
那么我如何决定哪个source 与哪个layer 一起工作?我在openlayers documents 页面中找不到。
【问题讨论】:
Opanlayers 当前版本有 layer 和 source 对象来查看矢量或平铺图像。
图层类型:图像、平铺和矢量
来源类型: ImageWMS、TileWMS、Geojson、OSM、Raster、Vector……
那么我如何决定哪个source 与哪个layer 一起工作?我在openlayers documents 页面中找不到。
【问题讨论】:
接受的源类型显示在层类型的文档中。它适用于 Image、Vector 和 VectorTile。在文档中列出了源类型的子类的地方,通常使用它们而不是基类。文档令人困惑地显示基类 Tile 作为 Tile 图层的源类型。其子类包括不合适的 VectorTile,因为它仅由 VectorTile 层使用,而 Tile 层仅使用 TileImage 或(很少)TileDebug 或 UFTGrid 的子类。 OSM 是 XYZ 的子类。 OpenLayers 5 中没有 GeoJSON 源类型,它只是 Vector 源使用的格式之一。
https://openlayers.org/en/latest/apidoc/module-ol_layer_Tile-TileLayer.html 使用https://openlayers.org/en/latest/apidoc/module-ol_source_TileImage-TileImage.html 或https://openlayers.org/en/latest/apidoc/module-ol_source_TileDebug-TileDebug.html 或https://openlayers.org/en/latest/apidoc/module-ol_source_UTFGrid-UTFGrid.html 的子类
https://openlayers.org/en/latest/apidoc/module-ol_layer_Image-ImageLayer.html 使用 https://openlayers.org/en/latest/apidoc/module-ol_source_Image-ImageSource.html
https://openlayers.org/en/latest/apidoc/module-ol_layer_Vector-VectorLayer.html 使用https://openlayers.org/en/latest/apidoc/module-ol_source_Vector-VectorSource.html
https://openlayers.org/en/latest/apidoc/module-ol_layer_VectorTile-VectorTileLayer.html 使用https://openlayers.org/en/latest/apidoc/module-ol_source_VectorTile-VectorTile.html
【讨论】: