code
// set full extent of base map
setFullExtentOfBaseMap() {
this.http.getFeature_GeoserverWFS(config.base_map_navigation_lyr_name,
"&cql_filter=profname=" + this.selectedProfNavDomain.id).subscribe(
res => {
if (res.features && res.features.length > 0) {
console.log(res.features);
let allCoords = [];
for (let item of res.features) {
if (item.geometry.type == 'Point') {
let _coord = item.geometry.coordinates;
allCoords.push(_coord);
}
}
console.log(allCoords);
let fullLine = new ol.geom.LineString(allCoords);
this.mapService.map.getView().fit(fullLine.getExtent(), { padding: [2, 2, 2, 2] });
//this.gisApiService.setExtentGeometries(this.mapService.map, res.features);
}
});
}