我正在将代码从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(打字稿)执行了魔术我还没有找到相应的?
任何帮助是极大的赞赏!
我相信函数仍然存在,只有语法已经改变:
import {extend} from 'ol/extent';
const largeExtent = extend(extent1, extent2);