Select to view content in your preferred language

Map doesn't show in browser using map components, calcite components with Angular.

284
2
Jump to solution
03-27-2025 01:22 PM
ForrestLin
Frequent Contributor

I'm working on website using map components, calcite components with Angular.

I create a angular component "esri-map" with arcgis-map
 
esri-map.component.html:
 <arcgis-map item-id="cece49703cc24b0783dffb3032b0679c"></arcgis-map>
 
I put it in <calcite-shell>:
 
app.component.html:
<calcite-shell>
    <app-esri-map ></app-esri-map>
 </calcite-shell>
 
The map doesn't show in browser. 
 
 I inspect the document:
 
ForrestLin_0-1743106959254.png
0 Kudos
1 Solution

Accepted Solutions
ForrestLin
Frequent Contributor

@ReneRubalcava 

You are right!  

`<app-esri-map>` element needs a height and width in css:

app-esri-map {
  padding: 0;
  margin: 0;
  height: 100%;
  width: 100%;
}
 
It works!
 
Thank you so much!
 
Forrest

View solution in original post

0 Kudos
2 Replies
ReneRubalcava
Honored Contributor

If you could provide a repro to look at, would be easier to see the problem. If I had to guess, your `<app-esri-map>` element needs a height and width in css. The `<arcgis-map>` component will grow to the size of it's container, so the container probably doesn't have them.

ForrestLin
Frequent Contributor

@ReneRubalcava 

You are right!  

`<app-esri-map>` element needs a height and width in css:

app-esri-map {
  padding: 0;
  margin: 0;
  height: 100%;
  width: 100%;
}
 
It works!
 
Thank you so much!
 
Forrest
0 Kudos