不具合 ID 番号 |
BUG-000163573 |
送信されました | December 8, 2023 |
最終更新日 | December 6, 2024 |
適用対象 | ArcGIS Maps SDK for JavaScript |
見つかったバージョン | 4.28 |
オペレーティング システム | Windows OS |
オペレーティング システムのバージョン | 11.0 64 bit |
ステータス | Known Limit
開発チームによる確認後に、この問題が、Esri の管理の範囲外にあるソフトウェアの既知の制限に関するものであると判断されました。 問題の「参考情報」セクションに、さらに詳細な説明が示されていることがあります。
|
参考情報
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.
対処法
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];
}
再現の手順