Angular OpenLayers 4扩展替换

Angular OpenLayers 4扩展替换,angular,typescript,openlayers,openlayers-3,openlayers-5,Angular,Typescript,Openlayers,Openlayers 3,Openlayers 5,我正在将代码从OpenLayers 3移动到OpenLayers 4(typescript) 我有一段代码可以扩展我的范围,这样当地图加载时,我画的所有矢量形状都可以看到 angular.forEach(webMapValues.vectorFieldLayer, function (Field, key) { webMapValues.mapObj.addLayer(Field); webMapValues.extent = Field.getSource().getExtent(); we

我正在将代码从OpenLayers 3移动到OpenLayers 4(typescript)

我有一段代码可以扩展我的范围,这样当地图加载时,我画的所有矢量形状都可以看到

angular.forEach(webMapValues.vectorFieldLayer, function (Field, key) 
{
webMapValues.mapObj.addLayer(Field);
webMapValues.extent = Field.getSource().getExtent();
webMapValues.totalExtent = ol.extent.extend(webMapValues.extent, 
webMapValues.totalExtent);
})
在上面的“ol.extent.extend”为我表演了魔术,而在OpenLayers 4(typescript)中,我还没有找到等效的


非常感谢您的帮助

我相信函数仍然存在,只是语法发生了变化:

import {extend} from 'ol/extent';

const largeExtent = extend(extent1, extent2);

我正在使用React、typescript和OL4,发现这对我有用

import extent from 'ol/extent';

const combinedExtent = extent.extend(<layer1>,<layer2>);
从“ol/范围”导入范围;
const combinedExtent=范围扩展(,);

我很困惑……我在“ol/extent”中没有看到“extend”,所以我再次安装了“ol”,以查看是否有更新版本。。。得到“ol@5.3.1但我没有将“extend”作为“ol/extent”中的函数。我有“角落”和“关系”?有没有关于我应该使用哪个版本的想法?我也很困惑。。。我刚刚用《快速入门指南》中的OL5.3.0尝试了ol.extent.extend(extend1,extend2),它似乎像预期的那样工作。好吧,我认为这是如何导入的。在node_模块中,我有一个文件夹ol,下面有一个名为“extent”的文件夹,还有一个名为“extent.js”的.js文件,如果我导入“ol/extent”,它会指向该文件夹…不知道如何让它指向.js文件…可能只是添加了“.js”?导入时,你仍然会收到错误吗?extend不再是一种扩展方法,它或多或少是一个独立的函数。我不知道如何使用extent.js文件