Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can only identify top layer in Grouped Layer configuration #930

Open
1 of 5 tasks
ishiland opened this issue Dec 8, 2019 · 5 comments
Open
1 of 5 tasks

Can only identify top layer in Grouped Layer configuration #930

ishiland opened this issue Dec 8, 2019 · 5 comments
Assignees
Milestone

Comments

@ishiland
Copy link

ishiland commented Dec 8, 2019

How often can you reproduce it?

  • 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
@tmcgee
Copy link
Member

tmcgee commented Dec 9, 2019

@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
Copy link
Author

ishiland commented Dec 9, 2019

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
Copy link
Author

ishiland commented Dec 9, 2019

@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
Copy link
Member

tmcgee commented Dec 10, 2019

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

@ishiland
Copy link
Author

ishiland commented Jan 1, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants