将 SVG 显示为 ImageLayer - OpenLayers

Displaying SVG as an ImageLayer - OpenLayers

如以下 GitHub 问题所标记,在 ImageLayer 中引用时,OpenLayers 无法正确显示 SVG 图像:

https://github.com/openlayers/openlayers/issues/4633

几个月前有一个解决方案,使用层 class 中的 "render" 属性: https://openlayers.org/en/master/apidoc/module-ol_layer_Layer.html#~RenderFunction

但我不知道如何正确实施。什么是帧状态,如何将其正确引用到渲染器 属性?

OpenLayers 背后的开发人员创建了一个示例来展示如何渲染 SVG 图像:

https://github.com/openlayers/openlayers/pull/10363