cmv / cmv-app

CMV - The Configurable Map Viewer - A community supported open source mapping framework built with the Esri JavaScript API and the Dojo Toolkit
https://demo.cmv.io/
MIT License
325 stars 278 forks source link

Can only identify top layer in Grouped Layer configuration #930

Open ishiland opened 4 years ago

ishiland commented 4 years ago

How often can you reproduce it?

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
tmcgee commented 4 years ago

@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.

ishiland commented 4 years ago

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 commented 4 years ago

@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.

tmcgee commented 4 years ago

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

ishiland commented 4 years ago

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