【问题标题】:How to match Openlayers source and layers?如何匹配 Openlayers 源和层?
【发布时间】:2019-07-12 08:49:56
【问题描述】:

Opanlayers 当前版本有 layersource 对象来查看矢量或平铺图像。

图层类型:图像、平铺和矢量

来源类型: ImageWMS、TileWMS、Geojson、OSM、Raster、Vector……

那么我如何决定哪个source 与哪个layer 一起工作?我在openlayers documents 页面中找不到。

【问题讨论】:

    标签: openlayers openlayers-5


    【解决方案1】:

    接受的源类型显示在层类型的文档中。它适用于 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.htmlhttps://openlayers.org/en/latest/apidoc/module-ol_source_TileDebug-TileDebug.htmlhttps://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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-13
    • 1970-01-01
    • 1970-01-01
    • 2021-11-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多