ESRI JS API 4.4 IdentifyTask with layerOption = "visible" also returns result for invisible layers

Discussion created by FluxysIT2 on Aug 29, 2017

The situation can be reproduced in the sandbox https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=tasks-identify


1. change the visibility of parcelsLyr as follows


var parcelsLyr = new TileLayer({
        url: soilURL,
        opacity: 0.85,
        visible: false


2. change the IdentifyParameters as follows:


// Set the parameters for the Identify
        params = new IdentifyParameters();
        params.tolerance = 3;
        params.layerIds = [0, 1, 2];
        params.layerOption = "visible";
        params.width = view.width;
        params.height = view.height;


3. click refresh

4. execute Identify


Result: we get an identify result with soil information, even when this layer is not visible.