We worked on the issue and we seem to have found a a workaround.
It works also if we are sure that it could be ehanced and otimized.
The only problem we notice is this message in firebug,. We don't know what it means but it do not impact on the functionality:
...
_initDeniedItems: function() {
var deniedItemsFromConfigKeys = [];
var menuItemDictionary = {
"ZoomTo": "zoomto",
"Transparency": "transparency",
"EnableOrDisablePopup": "controlPopup",
"MoveupOrMovedown": "moveup movedown",
"OpenAttributeTable": "table",
"DescriptionOrShowItemDetailsOrDownload": "url",
"RemoveLayer": "removelayer", //
};
...
...
constructor: function(layerInfo, displayItemInfos, layerType, layerListWidget) {
var l = displayItemInfos.length;
if (l > 5) {
displayItemInfos = { key: 'removelayer' }; //
}
...
...
...
...
_initCandidateMenuItems: function() {
//descriptionTitle: NlsStrings.value.itemDesc,
// var layerObjectUrl = (this._layerInfo.layerObject && this._layerInfo.layerObject.url) ?
// this._layerInfo.layerObject.url :
// '';
this._candidateMenuItems = [{
key: 'separator',
label: ''
}, {
key: 'empty',
label: this.nls.empty
}, {
key: 'zoomto',
label: this.nls.itemZoomTo
}, {
key: 'transparency',
label: this.nls.itemTransparency
}, {
key: 'moveup',
label: this.nls.itemMoveUp
}, {
key: 'movedown',
label: this.nls.itemMoveDown
}, {
key: 'table',
label: this.nls.itemToAttributeTable
}, {
key: 'controlPopup',
label: this.nls.removePopup
}, {
key: 'url',
label: this._getATagLabel()
},{
key: 'separator',
label: ''
}
,{ // key: 'removelayer', label: this.nls.itemRemoveLayer }];
},
...
...
_onItemRemoveLayer: function(evt) { // this._layerInfo.map.removeLayer(this._layerInfo.layerObject);}...
...\configs\LayerList\config_Contenuti mappa.json (the original file shoud be layerlist.json){
"showLegend": true,
"contextMenu": {
"ZoomTo": true,
"Transparency": true,
"EnableOrDisablePopup": true,
"MoveupOrMovedown": true,
"OpenAttributeTable": true,
"DescriptionOrShowItemDetailsOrDownload": true,
"RemoveLayer": true },
"layerOptions": {}
}
...\jimu.js\nls\main.js...
layerInfosMenu: {
titleBasemap: "Basemaps",
titleLayers: "Operational Layers",
labelLayer: "Layer Name",
itemZoomTo: "Zoom to",
itemTransparency: "Transparency",
itemTransparent: "Transparent",
itemOpaque: "Opaque",
itemMoveUp: "Move up",
itemMoveDown: "Move down",
itemDesc: "Description",
itemDownload: "Download",
itemToAttributeTable: "Open Attribute Table",
itemRemoveLayer: "Remove Layer"},
...
...\jimu.js\nls\it\main.js...
"layerInfosMenu": {
"titleBasemap": "Mappe di base",
"titleLayers": "Layer operativi",
"labelLayer": "Nome layer",
"itemZoomTo": "Zoom a",
"itemTransparency": "Trasparenza",
"itemTransparent": "Trasparente",
"itemOpaque": "Opaco",
"itemMoveUp": "Sposta su",
"itemMoveDown": "Sposta giù",
"itemDesc": "Descrizione",
"itemDownload": "Download",
"itemToAttributeTable": "Apri tabella attributi",
"itemRemoveLayer": "Rimuovi il layer"},
...
...\widgets\LayerList\nls\strings.jsdefine({
root: ({
_widgetLabel: "Layer List",
titleBasemap: "Basemaps",
titleLayers: "Operational Layers",
labelLayer: "Layer Name",
itemZoomTo: "Zoom to",
itemTransparency: "Transparency",
itemTransparent: "Transparent",
itemOpaque: "Opaque",
itemMoveUp: "Move up",
itemMoveDown: "Move down",
itemDesc: "Description",
itemDownload: "Download",
itemToAttributeTable: "Open Attribute Table",
itemShowItemDetails: "Show Item Details",
empty: "empty",
removePopup: "Disable Pop-up",
enablePopup: "Enable Pop-up",
turnAllLayersOff: "Turn All Layers Off",
turnAllLayersOn: "Turn All Layers On",
expandAllLayers: "Expand All Layers",
collapseAlllayers: "Collapse All layers",
turnAllLabelsOff: "Turn All Labels Off",
turnAllLabelsOn: "Turn All Labels On",
showLabels: "Show Labels",
hideLables: "Hide Labels",
itemTransparency: "Remove Layer" }),
...
...\widgets\LayerList\nls\it\strings.jsdefine({
"_widgetLabel": "Elenco layer",
"titleBasemap": "Mappe di base",
"titleLayers": "Layer operativi",
"labelLayer": "Nome layer",
"itemZoomTo": "Zoom a",
"itemTransparency": "Trasparenza",
"itemTransparent": "Trasparente",
"itemOpaque": "Opaco",
"itemMoveUp": "Sposta su",
"itemMoveDown": "Sposta giù",
"itemDesc": "Descrizione",
"itemDownload": "Download",
"itemToAttributeTable": "Apri tabella attributi",
"itemShowItemDetails": "Mostra dettagli elemento",
"empty": "vuoto",
"removePopup": "Disabilita popup",
"enablePopup": "Abilita popup",
"turnAllLayersOff": "Disattiva tutti i layer",
"turnAllLayersOn": "Attiva tutti i layer",
"expandAllLayers": "Espandi tutti i layer",
"collapseAlllayers": "Comprimi tutti i layer",
"turnAllLabelsOff": "Disattiva tutte le etichette",
"turnAllLabelsOn": "Attiva tutte le etichette",
"showLabels": "Mostra Etichette",
"hideLables": "Nascondi Etichette",
"itemRemoveLayer": "Rimuovi il layer"});
...\widgets\LayerList\config.json{
"showLegend": true,
"contextMenu": {
"ZoomTo": true,
"Transparency": true,
"EnableOrDisablePopup": true,
"MoveupOrMovedown": true,
"OpenAttributeTable": true,
"DescriptionOrShowItemDetailsOrDownload": true,
"RemoveLayer": true }
}