Vue+OpenLayers7入门到实战:OpenLayers7.x版本和6.x版本有什么区别,OpenLayers7.x版本是否支持超图地图和气象风场图?是否需要升级到OpenLayers7版本?

57 篇文章 1 订阅 ¥49.90 ¥99.00

返回《Vue+OpenLayers7》专栏目录:Vue+OpenLayers7入门到实战

前言

本章介绍一下OpenLayers7.x版本和OpenLayers6.x版本之间的区别,新版本升级了哪些功能,以及OpenLayers7是否支持超图地图和气象风场图,以及当前是否需要升级到OpenLayers7版本的问题。
Vue+OpenLayers7入门到实战

首先,我们先来看一下,升级了哪些功能。

OpenLayers7.x升级了哪些功能

  1. 停止对IE的支持(OpenLayers7不再支持 Internet Explorer)
  2. (实验性)webgl图层新增支持line线条渲染。
    但是经过博主实测,最新的OpenLayers7.5.2的webgl图层并不支持线条渲染,要到OpenLayers8版本才支持线条。
  3. (实验性)优化了webgl图层渲染性能,减少了5M左右的包大小。
  4. (实验性)webgl图层渲染支持low level style api(低级样式api),允许自定义webgl渲染样式
  5. 新增了刻度图层(Graticule)
    可以为坐标系渲染格网的图层(目前仅支持 EPSG:4326)
  6. 新增了Link
  7. 支持mapbox数据源和mapbox样式
  8. 支持TIFF数据源
  9. 支持webgl瓦片
  10. webgl图层样式新增加一个decay表达式
  11. 其他新增功能请参考官方发布版本文档:https://github.com/openlayers/openlayers

OpenLayers7版本发布原文

The 7.0 release includes an impressive batch of features and fixes from over 90 pull requests. We’re excited about a new foundation for WebGL vector rendering. The previous point rendering functionality has been extended to include lines and polygons. The rendering API is still low level and experimental. Future releases will include a higher level styling API.

In developing the new WebGL rendering functionality, we changed the signature for a number of methods on a helper class that had been marked as part of the API in 6.x releases. While this is technically a breaking change, it is unlikely that applications were using this helper class, so upgrades should be straightforward.

We took advantage of the breaking change in the WebGL helper class to remove a few other deprecated parts of the API. In addition, since Microsoft ended support for Internet Explorer a few months ago, we decided to do the same.

Backwards incompatible changes
Removal of deprecated properties and methods
The tilePixelRatio has been removed from the DataTile source.
The imageSmoothing option has been removed from sources.
The undefinedHTML option has been removed from the MousePosition control.
The forEachLayerAtPixel method has been removed from the Map class.
Deprecated options have been removed from the Overlay component.
The labelCache has been removed from the ol/render/canvas.js module.
Internet Explorer is no longer supported
Please see https://docs.microsoft.com/en-us/lifecycle/announcements/internet-explorer-11-end-of-support.

ol/webgl/Helper.js
The Helper constructor from the ol/webgl/Helper.js module is no longer part of the public API.

ol/coordinate.js
The toStringHDMS function from the ol/coordinate.js module now formats longitude, latitude pairs so that the minutes and seconds are omitted if they are zero. This changes the values displayed on graticules.

ol/layer/Graticule
The default intervals now align with integer minutes and seconds better suited to the default label formatter. If formatting in decimal degrees you may wish to specify custom intervals suited to that format.

ol/Collection
Inserting with setAt or insertAt beyond the current length used to create a sparse Collection with undefined inserted for any missing indexes. This will now throw an error instead.

ol/control/MousePosition
The control will now by default keep displaying the last mouse position when the mouse leaves the viewport. With placeholder: ’ ’ you can keep the old behaviour. The placeholder option no longer accepts false as a valid value, instead simply omit the option. The undefinedHTML option has been removed. You should use placeholder instead.

ol/PluggableMap
The PluggableMap class has been removed. If you want to create a custom map class, extend the Map class instead.

ol/style/Icon and ol/style/RegularShape
ol/style/Image and subclasses displacement is no longer scaled with the image. If you previously expected this unintended behavior you should now increase the displacement when setting the scale.

然后再让我们来看看,OpenLayers7的兼容性如何?

OpenLayers7版本是否兼容超图地图

OpenLayers7版本不支持超图地图。
为什么呢?
超图地图官方最多支持到6.x版本。
并且经过博主测试,OpenLayers7确实不兼容超图地图。

OpenLayers7版本是否兼容气象风场图

经过博主实测,ol-wind和wind-layer等气象风场图无法兼容OpenLayers7版本。
且维护开发者暂无计划额外支持OpenLayers7版本,可能后面会更新,但是截至到2024-1-24为止,目前并不支持OpenLayers7版本。

OpenLayers7版本兼容性结论

OpenLayers7版本当前截至到2024-1-24为止,第三方插件和商用地图兼容性还较差。
这点是不如OpenLayers6版本的。
因此,对于想要整合超图地图和需要使用到气象风场图的,可以参考博主的《Vue+OpenLayers6》的专栏,里面有详细介绍如何整合使用超图地图和气象风场图等案例。

除了插件兼容性和其他商业地图兼容性之外,OpenLayers6版本的api基本可以升级兼容OpenLayers7版本。

  • 6
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

汤姆猫不是猫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值