首页 > 解决方案 > 带有地图框图层缩放问题的 OpenLayers5

问题描述

我在 OpenLayers(最新版本)中遇到了 MapBox 矢量图层的问题。它适用于 mapboxjs,但我无法使其在 OL5 中正常工作。

问题是该图层以 14 倍缩放显示所有元素,非常远,并且有很多点元素,因此会降低浏览器的速度。在 mapbox 中,它不会这样做并正确加载所有元素。

new VectorTileSource({
            format: new MVT(),
            url: 'https://maps.blackcore.mx/planet/{z}/{x}/{y}.pbf?access_token=' + token
        })

有人让它工作吗?样式是否能够使元素呈现或不呈现还是瓷砖问题?

我尝试过使用官方示例的代码: https ://openlayers.org/en/latest/examples/mapbox-vector-tiles.html

还尝试了这个插件来测试样式: https ://github.com/boundlessgeo/ol-mapbox-style

标签: openlayersvector-tiles

解决方案


推荐阅读