I have implemented to load the map with the id of the map in this way:
  initializeMap(): Promise<any> {
    const container = this.mapViewEl.nativeElement;
    const webmap = new WebMap({
      portalItem: {
        id: 'e781f03655844e2ab9123343d21cf1'
      },
    });
    const view = new MapView({
      container,
      map: webmap
    });
    this.webmap = webmap;
    this.view = view;
    return this.view.when();
  }
now I need to load a map that is in url, how can I do it by loading the map with url ?
https://utility.arcgis.com/......../FeatureServer/0
Solved! Go to Solution.
That endpoint is a FeatureService, but the utility endpoint is different. Assuming you have a FeatureService, you can use a FeatureLayer and add it to the Map.
Here is the doc
https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html
Here's a tutorial on the subject as well.
https://developers.arcgis.com/javascript/latest/add-a-feature-layer/
That endpoint is a FeatureService, but the utility endpoint is different. Assuming you have a FeatureService, you can use a FeatureLayer and add it to the Map.
Here is the doc
https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html
Here's a tutorial on the subject as well.
https://developers.arcgis.com/javascript/latest/add-a-feature-layer/
Thank you very much, that's what I was looking for
