Bringing up pop-up of a specific feature layer when click even though this layer intersect with other layers.

921
4
05-29-2017 10:03 AM
DeanThompson
New Contributor II

I have a limited knowledge of programming. however I am creating a web map where when i click on a feature layer a pop up comes up with the attributes of that layer. The problem is that there are three other feature layers but i only want to access one.

0 Kudos
4 Replies
MirHashmi
Occasional Contributor

Hi,

I assume that you must be doing an Identify operation to get the feature information.  And you want to limit the results to a single feature class of your choice.  This can be controlled by passing the required layerid's in the identify parameters object.  Here is a reference and a sample for identify task. 

identifyTask = new IdentifyTask("https://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServe...");
            identifyParams = new IdentifyParameters();
            identifyParams.tolerance = 3;
            identifyParams.returnGeometry = true;
            identifyParams.layerIds = [0, 2];
            identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;
            identifyParams.width = map.width;
            identifyParams.height = map.height;‍‍‍‍‍‍‍‍

identifyParams.layerIds = [0,2]
0 Kudos
DeanThompson
New Contributor II

I have examined the example presented. However I am wondering if this can work on more than one feature service, for example:

var Layer1 = new ArcGISDynamicMapServiceLayer("...parcel/MapServer", {opacity: 0.2});

var Layer3 = new ArcGISDynamicMapServiceLayer("...community/MapServer", {opacity: 0.2});

var Layer3 = new ArcGISDynamicMapServiceLayer("...valuation/MapServer", {opacity: 0.2});

How do I get the IdentifyTask to work on all three?

0 Kudos
MirHashmi
Occasional Contributor

I think this stackexchange link will give you a head start to solve your problem. Although the sample given is based on old Api 2.4 but it gives an idea on how you can go about to solve identifying multiple services and showing their results.

DeanThompson
New Contributor II

Thank you. Will let you know how it goes.

0 Kudos