cmv-app icon indicating copy to clipboard operation
cmv-app copied to clipboard

Layer Control should use imageParameters on Dynamic layers

Open green3g opened this issue 7 years ago • 4 comments

I started looking into the sublayer visibility issue a little deeper and discovered yet another issue, this one with the layer control.

  1. On the latest develop version branch, if you zoom into Louisville (until you can see the smoke plume)
  2. toggle the Public safety layer ON and then OFF

Now there are less layers showing than when the app started. It appears the Emergency Operations layer is showing by default, but not checked in the layer control, and when another sublayer is toggled,

image

green3g avatar Sep 27 '16 15:09 green3g

If I am understanding the issue correctly, this does not seem to occur in the demo app using the current 1.3.4 release of CMV with version 3.14 of the Esri JavaScript API. I am wondering if this a new issue introduced in the CMV develop branch if it was something introduced in a release of the API after version 3.14. If so, we should look at this along side #367 and #601 and determine if it is a CMV bug or an API bug/change.

tmcgee avatar Sep 27 '16 16:09 tmcgee

Just looked into it a bit more, it seems to ONLY happen on that map service, at least with my testing. I can't reproduce it with my group layers/sub layers. Looking into the config a bit, I see we're using the ImageParameters function. This could be the cause.

Perhaps the layer control doesn't look at the property that the build image parameters is setting?

green3g avatar Sep 27 '16 17:09 green3g

This is caused by the imageParameters. When imageParameters are passed to a dynamic layer they are not used when creating a layer control for the layer and sublayers.

green3g avatar Oct 20 '16 17:10 green3g

A quick fix though for my situation is to set:

            layerControlLayerInfos: {
                expanded: true,
                sublayers: false
            }

This hides all the other layers but shows the legends on the ones in image parameters.

green3g avatar Oct 20 '16 17:10 green3g