Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleFeatureSelect(feature: Feature) {
if (feature.type === FeatureType.Feature) {
this.overlayService.setFeatures([feature], OverlayAction.ZoomIfOutMapExtent);
} else if (feature.type === FeatureType.DataSource) {
const map = this.mapService.getMap();
if (map !== undefined) {
this.layerService
.createAsyncLayer(feature.layer)
.subscribe(layer => {
map.addLayer(layer);
});
}
}
}
}