Select to view content in your preferred language

Get DisplayField from Layer loaded via WebMap

60
1
10 hours ago
SebastianKrings
Frequent Contributor

Hi,

we are loading our map from a WebMap which also contains all layers defined as part of the webmap via portal.

const webMap = new WebMap({
    portalItem: {
        id: defaultWebMapId
    }
});

await webMap.load();
map = webMap;

Unfortunately the field "DisplayField" is undefined for every layer.
This is how a layer looks on the service:

SebastianKrings_0-1778569434962.png

 

Why is it empty in JS after loading the webMap?

How do I get it otherwise?

0 Kudos
1 Reply
Sage_Wall
Esri Regular Contributor

It sounds like all the layer's haven't fully loaded, what happens if you use WebMap.loadAll()

0 Kudos