is it possible to remove a map service (or single layer) from the layer list?
It seems to me that in the WAB previous version this option was avaiable in the layer list widget.
Thank you
Enrico
Solved! Go to Solution.
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:
Any suggestion is appreciated
..\widgets\LayerList\PopupMenu.js
...
_initDeniedItems: function() {
var deniedItemsFromConfigKeys = [];
var menuItemDictionary = {
"ZoomTo": "zoomto",
"Transparency": "transparency",
"EnableOrDisablePopup": "controlPopup",
"MoveupOrMovedown": "moveup movedown",
"OpenAttributeTable": "table",
"DescriptionOrShowItemDetailsOrDownload": "url",
"RemoveLayer": "removelayer", //
};
...
..\widgets\LayerList\PopupMenuInfo.js
...
constructor: function(layerInfo, displayItemInfos, layerType, layerListWidget) {
var l = displayItemInfos.length;
if (l > 5) {
displayItemInfos
}
...
Enrico,
Sure in the LayerList widgets settings you choose which layer are visible in the widgets list:
Robert,
my question was not so clear, sorry.
I ask if it is possible to remove a map service that has been added before by other widget (ie Geoportal serach, add data widgets)
In one of the previous versions of WAB this option was available right-clicking on the layer, while now (WAB dev 2.1) is not visible.
Thank you
enrico
Enrico,
I wonder if that was a custom feature as I do not see the "Remove Layer" anywhere in the LayerList widgets code in version 2.0.
Maybe you're right : the specific example refers to an old customized app, based on some older version of WAB, but iIt seems me that the remove option was available in the past by default..(.?)
Anyway , i think this is a fundamental feature that "layer list widget " should have.
Do you think it is possible add this function in layer list?
thank you
Thread bump. Having this feature would be a fantastic addition as we have users who will add Operational Layers "by mistake" to the application and then confuse themselves. Keeping a clean interface is ideal - especially for users who are not particularly tech-savvy.
Devon, I totally agree.
If the app has "Add" functions (Add data, Geoportal search, addshapefile etc) SHOULD have a Remove tool.
We investigated the code but we haven't found any solution... but we are JS programming newbie ...
Hope someone could contribute !
Enrico,
The Add Data widget has a remove button when you add a layer. I also think I remember a remove layer option on the Layer List widget but there was likely a reason it was removed.
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:
Any suggestion is appreciated
..\widgets\LayerList\PopupMenu.js
...
_initDeniedItems: function() {
var deniedItemsFromConfigKeys = [];
var menuItemDictionary = {
"ZoomTo": "zoomto",
"Transparency": "transparency",
"EnableOrDisablePopup": "controlPopup",
"MoveupOrMovedown": "moveup movedown",
"OpenAttributeTable": "table",
"DescriptionOrShowItemDetailsOrDownload": "url",
"RemoveLayer": "removelayer", //
};
...
..\widgets\LayerList\PopupMenuInfo.js
...
constructor: function(layerInfo, displayItemInfos, layerType, layerListWidget) {
var l = displayItemInfos.length;
if (l > 5) {
displayItemInfos
}
...
Enrico,
For some reason you images are not showing in your post. What are you using to determine if the remove layer option should be shown?
if (l > 5) {
displayItemInfos[l] = { key: 'removelayer' }; //
}