Hello! Let me explain better my issue:
- I created (in a typical way) a map View in the angular "component One":
export class MapComponent implements OnInit, OnDestroy {
view: any;
@ViewChild('esriMap', { static: true }) private mapViewEl!: ElementRef;
initializeMap(): Promise<any> {
const container = this.mapViewEl.nativeElement;
esriConfig.portalUrl = "....";
const webmap = new WebMap({
portalItem: {
id: '...',
},
});
const layer = new FeatureLayer({
// URL to the service
URL: "..."
});
webmap.add(layer)
const view = new MapView({
container,
map: webmap,
zoom: 3,
constraints: {
minZoom: 3
}
});
this.view = view;
return this.view.when();
}
Then I need to use the "goTo" method in another angular component, let's call it "component Two".
How can I access the view defined in the component One from the component Two? Is it possible?
Thank you so much