OpenLayers9.1.0版本正式发布,OpenLayers9.1.0值得升级吗?9.1.0版相比9.0.0版本又更新了哪些内容?OpenLayers9相较于OpenLayers8更新了哪些内容?

Vue+OpenLayers中文教程推荐,不同于OpenLayers官方文档使用html+js原生原生教程,博主专栏包含大量vue整合案例和实际开发案例,非常适合地图开发小白快速入门。

OpenLayers6教程

  1. vue整合OpenLayers6入门教程: 《Vue+OpenLayers6入门教程》
  2. vue整合OpenLayers6实战中文教程,包含大量OpenLayers官方文档没有涉及到的实际开发案例: 《Vue+OpenLayers6实战进阶专栏目录》

OpenLayers7教程
3. Vue+OpenLayers7入门到实战教程

前言

OpenLayers9.1.0版本正式发布,最近两年OpenLayers更新频率很高 ,最近OpenLayers大版本迭代很快,但是几乎没有什么重大的功能更新。
比如这次的OpenLayers9.1.0几乎都是修修补补,没有功能更改和升级。

OpenLayers9相较于OpenLayers8更新了哪些内容

OpenLayers9.0.0版本相比OpenLayers8也就新增了一个Google
地图源和一些WebGL样式扩展,并删除原有的flushDeclutterItems()方法,其他也没有什么实质性的重大更新。

总而言之,没有必要升级,除非有特别需要,可以继续使用之前OpenLayers版本。

OpenLayers9两个版本更新内容

下面是OpenLayers9.1.0版本和OpenLayers9.0.0版本的发布的更新内容

OpenLayers9.1.0版本更新内容

The 9.1 release fixes a few rendering regressions introduced in v9.0.
It introduces bulk feature removal in Vector sources, addresses
attribution consistency, includes new style operators, and adds the
Alidade Satellite style to the Stamen source. Moreover, it ensures
compliance with Google's terms of use for attribution handling of the
Google source.

翻译:

9.1 版本修复了 v9.0 中引入的一些渲染回归。它在矢量源中引入了批量特征删除,解决了归因一致性问题,包括新的样式运算符,并将 Alidade Satellite 样式添加到 Stamen 源中。此外,它还确保遵守 Google 关于 Google 来源归因处理的使用条款。

OpenLayers9.0.0版本更新内容

The 9.0 release adds several new features, including a Google Maps
source (finally!), improved WebGL line rendering, and a new symbol and
text decluttering implementation. We also improved and broadened flat
styles support for both WebGL and Canvas 2D renderers. For better
developer experience, we made more types generic and fixed some issues
with types.

Backwards incompatible changes

  • Improved render order of decluttered
    items Decluttered items in Vector and VectorTile layers now maintain
    the render order of the layers and within a layer. They do not get
    lifted to a higher place in the stack any more.

For most use cases, this is the desired behavior. If, however, you've
been relying on the previous behavior, you now have to create separate
layers above the layer stack, with just the styles for the declutter
items.

  • Removal of Map#flushDeclutterItems()
    It is no longer necessary to call this function to put layers above decluttered symbols and text,
    because decluttering no longer lifts elements above the layer stack.

To upgrade, simply remove the code where you use the
flushDeclutterItems() method.

  • Changes in ol/style

    1. Removed the ol/style/RegularShape's radius1
      property. Use radius for regular polygons or radius and radius2 for
      stars.
    1. Removed the shape-radius1 property from
      ol/style/flat~FlatShape. Use shape-radius instead.
  • GeometryCollection constructor
    ol/geom/GeometryCollection can no longer be created
    without providing a Geometry array. Empty arrays are still valid.

  • ol/interaction/Draw
    The finishDrawing() method now returns the drawn
    feature or null if no drawing could be finished. Previously it
    returned undefined.

翻译

9.0 版本增加了一些新功能,包括 Google 地图源(终于!)、改进的 WebGL 线渲染以及新的符号和文本整理实现。我们还改进并扩展了对 WebGL 和 Canvas 2D 渲染器的平面样式支持。为了获得更好的开发人员体验,我们使更多类型通用,并修复了类型的一些问题。
向后不兼容的更改

  • 改进了整理项的渲染顺序
    Vector 和 VectorTile 图层中的整理项目现在保持图层和图层内的渲染顺序。它们不再被提升到堆栈中的更高位置。
    对于大多数用例,这是所需的行为。但是,如果您一直依赖以前的行为,则现在必须在图层堆栈上方创建单独的图层,并且仅使用整理项的样式。

  • 删除 Map#flushDeclutterItems()
    不再需要调用此函数来将图层放在整理的符号和文本上方,因为整理不再将元素提升到图层堆栈上方。
    如果要升级到新版本,只需删除使用 flushDeclutterItems() 方法的代码。

  • ol/style的变化

    1. 删除了 ol/style/RegularShape 的 radius1 属性。对正多边形使用半径,对星星使用半径和半径2。
    1. ol/style/flat~FlatShape 中删除了 shape-radius1 属性。请改用 shape-radius。
  • GeometryCollection 构造函数
    如果不提供 GeometryCollection,则无法再创建 ol/geom/GeometryCollection。空数组仍然有效。

  • ol/interaction/Draw
    finishDrawing()方法现在返回绘制的特征,如果无法完成绘制,则返回null。以前,它返回 undefined。


end

Vue+OpenLayers中文教程推荐,不同于OpenLayers官方文档使用html+js原生原生教程,博主专栏包含大量vue整合案例和实际开发案例,非常适合地图开发小白快速入门。

OpenLayers6教程

  1. vue整合OpenLayers6入门教程: 《Vue+OpenLayers6入门教程》
  2. vue整合OpenLayers6实战中文教程,包含大量OpenLayers官方文档没有涉及到的实际开发案例: 《Vue+OpenLayers6实战进阶专栏目录》

OpenLayers7教程
3. Vue+OpenLayers7入门到实战教程