I need to navigate through stacked elements on a click event.

3950
5
05-05-2015 12:48 PM
ChrisSergent
Regular Contributor III

We have sign supports and street sign layers. Sometimes the layers will be stacked and the elements will be too. What do I need to do to navigate through the layers and the elements of the layer that are located at the exact same location?

Here is what I have to evaluate an individual element from the street supports layer:

 var supportId, type, address;
        app.supportLayer.on("click", function (evt) {
            supportId = evt.graphic.attributes.SUPPORTID;
            type = evt.graphic.attributes.TYPE;
            address = evt.graphic.attributes.ADDRESS;
            app.attributesModal.modal("show");
            document.getElementById("address").value = address;
            console.log(supportId);
            console.log(type);
            console.log(address);
        });

Here is an editor widget that does the same thing. I had to make a larger form for mobile devices:

signForm1.png

signForm2.png

5 Replies
ChrisSmith7
Frequent Contributor

Would an identify task work for you?

Identify features on a map | ArcGIS API for JavaScript

There is a parameter "layerOption" that you can specify (LAYER_OPTION_ALL, LAYER_OPTION_TOP, LAYER_OPTION_VISIBLE)

IdentifyParameters | API Reference | ArcGIS API for JavaScript 

ChrisSmith7
Frequent Contributor

If you need to do the same with graphics, there's a method to do this, too!

Find graphics under a mouse click with the ArcGIS API for JavaScript | ArcGIS Blog

0 Kudos
ChrisSergent
Regular Contributor III

I've had something like that for another app, but I need to populate a form for field use and data entry on a mobile device.

0 Kudos
KenBuja
MVP Esteemed Contributor

I use another type of popup when there are many features at the same point in this application. I'm returning all the features for the visible layers found in an IdentifyTask and put them into a dGrid. The features are grouped by layer on separate tabs.

ChrisSergent
Regular Contributor III

I could possibly hide the grid and then get the value of the element of the grid. It looks some identifies place multiple rows as the identified location. Still need to navigate between layers or in that case tabs. Are you able to get values from an individual cell?