laptop and a wrench

Bogue

In ArcGIS Maps SDK for JavaScript 4.28, the properties of a WMSSubLayer like minScale and maxScale can only be read correctly if the SubLayer is added subsequently.

ArcGIS Maps SDK for JavaScript
Numéro d’ID de bogue BUG-000163573
EnvoiDecember 8, 2023
Dernière modificationDecember 6, 2024
S’applique àArcGIS Maps SDK for JavaScript
Version trouvée4.28
Système d’exploitationWindows OS
Version du système d’exploitation11.0 64 bit
StatutKnown Limit

Informations supplémentaires

When assigning a value to WMSLayer.sublayers at layer initialization, it essentially overwrites the layer's sublayers discovered from the service's get capabilities response. Unless specified, all sublayer properties are set to their default values, instead of the values found in the service. The solution is to wait for the layer to load and then 'turn off' the undesired sublayers. This ensures that all sublayer properties, like minScale and maxScale, are imported from the layer's get capabilities response. For example: const wmsLayer = new WMSLayer({   url: "your-url-here" }); await wmsLayer.load(); const sublayer = wmsLayer.findSublayerByName("my-sublayer-name"); if (sublayer) { // check if sublayer exists   wmsLayer.sublayers = [sublayer]; // only show desired sublayer } map.add(wmsLayer); The team plans to update the documentation to make this more clear.

Solution de contournement

Add the WMSSubLayer subsequently.

For example: const wmsLayer = new WMSLayer({ url: "your-url-here" }); await wmsLayer.load(); const sublayer = wmsLayer.findSublayerByName("my-sublayer-name"); if (sublayer) { // check if sublayer exists wmsLayer.sublayers = [sublayer]; }

Étapes pour reproduire

ID de bogue: BUG-000163573

Logiciel:

  • ArcGIS Maps SDK for JavaScript

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement