Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#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


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( != "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 Changed 3 years ago by jng

Owner: changed from madair to jng

comment:2 Changed 3 years ago by jng

Resolution: wontfix
Status: newclosed

Closing this as wontfix as I'll be taking the same stance on this as this old discussion thread on mapguide-internals:

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)

comment:3 Changed 3 years ago by jng

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

Note: See TracTickets for help on using tickets.