[fusion-trac] #642: Select Within Widget does not filter unavailable layers

Fusion trac_fusion at osgeo.org
Fri Apr 29 08:02:17 PDT 2016


#642: Select Within Widget does not filter unavailable layers
-----------------------------+----------------------
        Reporter:  gluckett  |        Owner:  madair
            Type:  defect    |       Status:  new
        Priority:  P2        |    Milestone:  Future
       Component:  Widgets   |      Version:  2.0
        Severity:  Major     |     Keywords:
         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(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;
 }

--
Ticket URL: <http://trac.osgeo.org/fusion/ticket/642>
Fusion <http://trac.osgeo.org/fusion>
Fusion is a web-mapping application development framework for MapServer and MapGuide OS.


More information about the fusion-trac mailing list