Playing with the following sample, loading a webMap from a PortalItem id:
Load a basic WebMap | ArcGIS API for JavaScript 4.7
I noticed that a WebMap containing a MapService with custom layers visibility defined in AGOL (overwriting thus the default ones from the service) are not respected using arcgis js api 4.7. Layers visibility configuration is the one of the service and not the one of webmap.
I know WebMap is partially supported:
WebMap | API Reference | ArcGIS API for JavaScript 4.7
but even with a map service that has dynamic layers enabled, it is still not respected.
Is it a temporary limitation ? Maybe linked to AGOL ?
Cheers
Nicolas