Enrico,
I did not test that. Here are the tested changes:
[install dir]\server\apps\[app#]\jimu.js\LayerInfos\LayerInfoForDefaultService.js:
_initControlPopup: function() {
var mapServiceLayer = this.originOperLayer.mapService.layerInfo.layerObject;
var subId = this.originOperLayer.mapService.subId;
setTimeout(lang.hitch(this,function(){
this.loadInfoTemplate().then(lang.hitch(this, function(){
this.enablePopup();
}));
}), 500);
this.controlPopupInfo = {
enablePopup: (mapServiceLayer.infoTemplates && mapServiceLayer.infoTemplates[subId]) ?
true:
false,
infoTemplates: undefined
};
},
[install dir]\server\apps\[app#]\jimu.js\LayerInfos\LayerInfoForDefault.js:
_initControlPopup: function() {
this.controlPopupInfo = {
enablePopup: this.layerObject.infoTemplate ? true: false,
infoTemplate: this.layerObject.infoTemplate
};
this.layerObject._infoTemplate = this.layerObject.infoTemplate;
aspect.after(this.layerObject, "setInfoTemplate", lang.hitch(this, function(){
this.layerObject._infoTemplate = this.layerObject.infoTemplate;
this.controlPopupInfo.infoTemplate = this.layerObject.infoTemplate;
if(!this.controlPopupInfo.enablePopup) {
this.layerObject.infoTemplate = null;
}
}));
setTimeout(lang.hitch(this,function(){
this.loadInfoTemplate().then(lang.hitch(this, function(){
this.enablePopup();
}));
}), 500);
},