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

Can only identify top layer in Grouped Layer configuration

Open ishiland opened this issue 4 years ago • 5 comments

How often can you reproduce it?

  • [X] Always
  • [ ] Sometimes
  • [ ] Rarely
  • [ ] Unable
  • [ ] I didn’t try

Description: When performing identify against multiple visible layers in a "Grouped Layer" configuration, only the top most layer can be identified.

Steps to reproduce: Create a Grouped layer and turn on all layers. Try to identify a layer beneath the top layer.

JS Bin here: https://jsbin.com/viguseyini/edit?js,output

Expected results: Its expected to be able to cycle through all layers that are at the identify location.

Actual results: Only the top most visible layer can be identified.

Environment:

Software Version
CMV Version 2.0.0 beta-2
Browser chrome
Operating system mac

ishiland avatar Dec 08 '19 18:12 ishiland

@ishiland Grouping is only for the LayerList widget and doesn't affect the Identify functionality in any way. You'll notice that the identify behavior is the same for these layers regardless of whether they are in a Grouped layer or not. Using your example, I can identify the continents layer both when grouped and when not grouped.

If you mean that you cannot identify features from both layers with a single click, that is the expected behavior. Since the top-most graphic captures the mouse click, only one graphic feature can be identified at any one time - regardless of the layer. This is a limitation of the Esri JavaScript API.

tmcgee avatar Dec 09 '19 16:12 tmcgee

If you mean that you cannot identify features from both layers with a single click, that is the expected behavior. Since the top-most graphic captures the mouse click, only one graphic feature can be identified at any one time - regardless of the layer. This is a limitation of the Esri JavaScript API.

This is exactly the problem. Are you aware of any work around? My requirements are to be able to identify multiple grouped layers with a single click. I have not looked at the code yet but Im hoping for some sort of solution.

ishiland avatar Dec 09 '19 17:12 ishiland

@tmcgee just to follow up, im getting this error when choosing "Restaurants" as the single layer in the identify widget:

source Identify _ControllerBase.js:95 error Error at Object.h.load (init.js:755) at init.js:88 at c (init.js:104) at e (init.js:104) at b.Deferred.resolve.callback (init.js:105) at c (init.js:105) at e (init.js:104) at b.Deferred.resolve.callback (init.js:105) at init.js:93 at k (init.js:108)

When I select "continent" I actually get the expected results Im looking for: image

As originally reported, "All Visible Layers" only seems to identify the top layer, restaurants.

I will take a look at the code later today. I appreciate any direction you can offer.

ishiland avatar Dec 09 '19 19:12 ishiland

@ishiland Confirmed. I see both behaviors you describe using jsBin. I am not sure why but will investigate.

tmcgee avatar Dec 10 '19 01:12 tmcgee

I ended up using the identify.js prior to this commit and all is well.

ishiland avatar Jan 01 '20 19:01 ishiland