OpenLayers 4 extent.extend替换

问题描述 投票:0回答:1

我正在将代码从OpenLayers 3移动到OpenLayers 4(打字稿)

我有这段代码可以扩展我的范围,以便我绘制的所有矢量形状在地图加载时都可见...

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(打字稿)执行了魔术我还没有找到相应的?

任何帮助是极大的赞赏!

angular typescript openlayers openlayers-3 openlayers-5
1个回答
0
投票

我相信函数仍然存在,只有语法已经改变:

import {extend} from 'ol/extent';

const largeExtent = extend(extent1, extent2);
© www.soinside.com 2019 - 2024. All rights reserved.