I am currently in the process of migrating my code from OpenLayers 3 to OpenLayers 4 using TypeScript.
Previously, I had a code snippet that extended the extent of my map so that all vector shapes I drew would be visible upon loading...
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);
})
In the above snippet, the "ol.extent.extend" function worked like magic for me. However, in OpenLayers 4 with TypeScript, I have been struggling to find an equivalent method.
Any guidance or assistance on this matter would be highly appreciated!