openlayers - 带有地图框图层缩放问题的 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
解决方案
推荐阅读
- c++ - '.' 是什么意思?表达式中的 60 后均值?
- docker - 自定义运行时不会使用 Dockerfile
- caching - 如何以编程方式使 Quarkus 缓存无效?
- javascript - 在客户端和服务器端之间发送信息和变量
- java - ConcurrentSkipListMap 如何正确使用
- python - 输入到 tensorflow nn 的数据显然格式不正确
- javascript - onchange 事件在 reactjs 组件中不起作用
- typescript - 如何隐式推断特定类型
- css - 与 CSS 网格居中对齐
- javascript - 有没有办法使用 JavaScript 找到字体中可用的所有功能