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.
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]
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?
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.
Thank you. Will let you know how it goes.