使用 ol.control.defaults.extend 自定义构建

custom build with ol.control.defaults.extend

我不知道如何在自定义构建中定义导出。在我的地图定义中,我有:

controls: ol.control.defaults({ zoom: false, attribution: false })
  .extend([attribution])

但我似乎无法在我的 build.json 文件中找到正确的 "exports"。当我构建时,出现如下错误:

No matching symbol found: ol.control.defaults.extend

在我的 build.json 文件中我有:

"ol.Attribution",
"ol.control.Attribution",
"ol.control.defaults",

后跟以下各项,一次一个:

"ol.control#extend",
"ol.control.extend",
"ol.control.defaults#extend",
"ol.control.defaults.extend",

(显然是试错法)关于我忽略了什么的任何线索? "extend" 是某个其他对象的成员吗?

谢谢, 富有

extend 是一种 ol.Collection 方法,因此请将此 "ol.Collection#extend" 添加到您的 build.json.