#642 closed defect (wontfix)
Select Within Widget does not filter unavailable layers
Reported by: | gluckett | Owned by: | jng |
---|---|---|---|
Priority: | P2 | Milestone: | Future |
Component: | Widgets | Version: | 2.0 |
Severity: | Major | Keywords: | |
Cc: | Browser: | All | |
External ID: | Operating System: | All | |
state: | New |
Description
When using Select Within, layers that are not turned on or hidden are available to the user. There should be a filter to only select those layers that are turned on and selectable - and their parent Group is turned on.
Something like the following:
function FillLayerList() {
GL: FILTER BASED ON LEGEND var currentVisibleLayer=0; var list = document.getElementById("layers"); var listNames = document.getElementById("layerNames"); list.options.length = 0; var map = GetParent().Fusion.getMapByName(mapName); var layers = map.aMaps[0].getSelectableLayers(); if(layers.length > 0) { for(var i = 0; i < layers.length; i++) { var layer = layers[i]; if(layer.visible) { var groupVisible = true; var currentGroup = layer.parentGroup; while(currentGroup.name != "layerRoot") { if(!currentGroup.visible) groupVisible=false; currentGroup = currentGroup.parentGroup;
} if(groupVisible!=false) { list.options[currentVisibleLayer] = new Option(layer.legendLabel != ""? layer.legendLabel: layer.layerName); if (i == 0) list.options[0].selected = true; listNames.options[currentVisibleLayer] = new Option(layer.layerName); currentVisibleLayer++; } } } } else {
list.options[0] = new Option("#BUFFERNOLAYER#"); } document.getElementById("Done").disabled = layers.length == 0;
}
Change History (3)
comment:1 by , 8 years ago
Owner: | changed from | to
---|
comment:2 by , 8 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:3 by , 8 years ago
On second thought, I'll make the fix (this ticket is actually a duplicate of #637)
But I'll make the behavior configurable through a new widget extension property
Closing this as wontfix as I'll be taking the same stance on this as this old discussion thread on mapguide-internals:
http://osgeo-org.1560.x6.nabble.com/PATCH-Ticket-2032-Selected-Map-Features-remain-visible-after-layer-is-turned-off-td4983823.html
The layer list derived from the current selection should be respected by anything that wants to know about what layers are in the current selection, regardless of current layer visibility (map or legend)