[fusion-commits] r2207 - sandbox/jxlib-3.0/widgets
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed Aug 25 14:38:26 EDT 2010
Author: madair
Date: 2010-08-25 18:38:26 +0000 (Wed, 25 Aug 2010)
New Revision: 2207
Modified:
sandbox/jxlib-3.0/widgets/SelectionPanel.js
Log:
fix for selecting a layer when there is a generic base layer
Modified: sandbox/jxlib-3.0/widgets/SelectionPanel.js
===================================================================
--- sandbox/jxlib-3.0/widgets/SelectionPanel.js 2010-08-25 18:27:07 UTC (rev 2206)
+++ sandbox/jxlib-3.0/widgets/SelectionPanel.js 2010-08-25 18:38:26 UTC (rev 2207)
@@ -336,8 +336,19 @@
var nLayers = this.oSelection.getNumLayers();
for (var i=0; i<nLayers; i++) {
var layerObj = this.oSelection.getLayer(i);
+
//find the legend label from the Map layer objects
- var mapLayers = this.getMap().aMaps[0].aLayers; //TODO: allow multiple maps
+ //join up all layers from all maps into an array
+ var mapLayers = [];
+ var map = this.getMap();
+ for (j=0; j<map.aMaps.length; ++j) {
+ if (map.aMaps[j].aLayers) {
+ for (k=0; k<map.aMaps[j].aLayers.length; ++k) {
+ mapLayers.push(map.aMaps[j].aLayers[k]);
+ }
+ }
+ }
+
var labelName = layerObj.getName();
for (var j=0; j<mapLayers.length; ++j) {
if (mapLayers[j].layerName == labelName) {
More information about the fusion-commits
mailing list