AnsweredAssumed Answered

Different Identify Params Tolerances In One Popup

Question asked by lloydbronn on Oct 5, 2016
Latest reply on Oct 5, 2016 by lloydbronn

I have a map service with feature and raster layers. I'm trying to configure my popup so that it only displays results from the visible layers toggled on in the layer list. This works setting identifyParams.layerIds = analysisLayer.visibleLayers. However, I need an identifyParams tolerance of around 7 pixels for the features, and 1 pixel for the rasters. Only setting one tolerance gives me results from one or the other. Is it possible to set two difference tolerances in one popup? I've tried writing an if/else statement to define the different tolerances, but the popup disappeared from the map. Here is the code snippet:

 

function mapReady() {
                    map.on("click", executeIdentifyTask);
                        
                    //create identify tasks and setup parameters
                    identifyTask = new IdentifyTask(analysisURL);
                    identifyParams = new IdentifyParameters();
                    identifyParams.returnGeometry = true;
                    //identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;
                         //identifyParams.tolerance = 7;
                         //identifyParams.layerIds = [1,2,4,5,6,8,9];
                    //identifyParams.tolerance = 1;
                    //identifyParams.layerIds = [12,13,14,17,18,19];
                    identifyParams.width = map.width;
                    identifyParams.height = map.height;
                         promises = [];
    
                }
               
                    function executeIdentifyTask(event) {
                    identifyParams.geometry = event.mapPoint;
                    identifyParams.mapExtent = map.extent;
                    identifyParams.layerIds = analysisLayer.visibleLayers;
                         promises.push(identifyTask.execute(identifyParams));
                   
                        

                    var iPromises = new all(promises);
                    iPromises.then(lang.hitch(this, function (r) {
                      var idResults = [];
                      arrayUtils.map(r, function(response) {
                        arrayUtils.map(response, function(result) {
                          var feature = result.feature;
                          var layerName = result.layerName;
                          feature.attributes.layerName = layerName;
                          var iTemplate;

Outcomes