Select to view content in your preferred language

More than 9 layer list group layers breaks Elevation Profile widget

329
1
04-24-2023 10:21 AM
Key
by
New Contributor II

Just ran into something strange today using Maps SDK 4.26

I am using the layerlist/legend widget  and when I add more than 9 group layers to the map it breaks the elevation profile widget only to the point the ground layer isnt being read.

Anyone else experience this behavior? 

0 Kudos
1 Reply
TomSellsted
MVP Regular Contributor

Key,

I was having the same issue.  I didn't realize that it was a group layer issue until I found your post.  I did some experimenting and discovered that this issue started with the 4.22 release of the SDK.  I substituted different webmaps with or without group layers and the behavior definitely changes.  It works at 4.21, but not at 4.22.

I did a workaround instead of setting the ground to world-elevation that works.  Here is the code:

    const elevationWidget = new ElevationProfile({
        view: view,
        profiles: [{type: "query",
            source: new ElevationLayer({url: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"}),
            color: "orange",
            title: "Ground elevation"}],
        visibleElements: {selectButton: false},
        unit: "feet",
        container: "elevation-container"
    });

This works with the group layers and should resolve your issue.

 

Regards,

Tom

0 Kudos