Robert, I tried with this code:
startup: function () {
this.inherited(arguments);
var layer,layerId;
LayerInfos.getInstance(this.map, this.map.itemInfo).then(lang.hitch(function(operLayerInfos) {
operLayerInfos.getLayerInfoArray().forEach(lang.hitch(this, function(layerInfo) {
if (layerInfo.title == 'Map') {
layerId = layerInfo.id;
console.log('layer ID = ', layerId);
}
}));
}
));
layer = this.map.getLayer(layerId);
console.info(layer);
this.own(on(layer, "click", lang.hitch(this, this.onMapClick)));
this.displayPopupContent(this.popup.getSelectedFeature());
},
console write all the info of the layer...but...nothing happens on onMapClick event...
Thanks,
Naty