AnsweredAssumed Answered

IdentifyCallback / ExecuteIdentifyTask not returning results

Question asked by tylerjones81 on Dec 15, 2015
Latest reply on Dec 15, 2015 by tylerjones81

I am trying to display a popup based on the identify module. For some reason, my identify task is not returning results. Here is the code:

 

executeIdentifyTask: function (evt) {

 

            this.previewMode = false;  

 

            this.map.infoWindow.hide();

            this.map.infoWindow.clearFeatures();

 

            // don't identify on shift-click, ctrl-click or alt-click

            if (evt.shiftKey || evt.ctrlKey || evt.altKey) {

                return;

            }

 

            var mapPoint = evt.mapPoint;

            var identifyParams = this.createIdentifyParams(mapPoint);

            var identifies = [];

            var identifiedlayers = [];

            var selectedLayer = this.getSelectedLayer();

 

 

            array.forEach(this.layers, lang.hitch(this, function (layer) {

                var layerIds = this.getLayerIds(layer, selectedLayer);

                if (layerIds.length > 0) {

                    var params = lang.clone(identifyParams);

                    params.layerDefinitions = layer.ref.layerDefinitions;

                    params.layerIds = layerIds;

                    identifies.push(layer.identifyTask.execute(params));

                    identifiedlayers.push(layer);

                }

            }));

 

 

            if (identifies.length > 0) {

                this.map.infoWindow.setTitle(this.i18n.mapInfoWindow.identifyingTitle);

                this.map.infoWindow.setContent('<div class="loading"></div>');

                all(identifies).then(lang.hitch(this, 'identifyCallback', identifiedlayers, mapPoint), lang.hitch(this, 'identifyError'));

            } else {

                this.previewMode = true;

            }

        },

Outcomes