方法将javascript代码和函数从openlayers 4.4更新到6



我使用openlayers 4.4创建了一个web映射接口。是否有一种特殊的方法来更新代码和功能以与版本6兼容?

如果继续使用中的ol.js构建https://openlayers.org/en/latest/doc/quickstart.html许多映射将继续工作,或者只需要在升级说明中记录的微小更改。最常见的问题可能是:

https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#new-内部瓦片坐标

https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#new-预渲染和后渲染层事件替换旧的预合成渲染和后合成事件

https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#layers-can-on-be-added-to-single-map(这通常会影响带有OverviewMap控件的地图(

https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#removal-嗅觉功能

https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#replacement-具有olsphere函数的olsphere构造函数

https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#changes-同相四积分

https://github.com/openlayers/openlayers/blob/main/changelog/upgrade-notes.md#renaming-在olformatfeature类及其子类的选项和属性中的defaultdataprojection

此外,地图将不再以默认大小打开,因此您需要使用css或以其他方式设置地图的大小div。

最新更新