小编Thi*_*rry的帖子

ol/controls/default 不是 OpenLayers 7.1 中的函数

使用 OpenLayers 6.15.1,我可以在地图选项中使用以下代码:

controls: ol.control.defaults({
    zoom: true,
    attribution: true,
    rotate: false
}),
Run Code Online (Sandbox Code Playgroud)

对于 OpenLayers 7.1,这不再起作用。我收到错误:

未捕获的类型错误:ol.control.defaults 不是函数

有谁可以向我解释我必须在代码中更改什么?我在 OpenLayers 官方在线文档中没有找到任何关于 ol/control/defaults 的明确内容可以解释此错误。

javascript openlayers openlayers-6 openlayers-7

4
推荐指数
1
解决办法
2400
查看次数