You need to log in before you can comment on or make changes to this bug.
As I use css to highlight the active layer some problems have arisen with the contents of the javascript array of the LegendTemplateGetLayerName function. For instance, when starting with a normal application with 2 layers, then loading a context of 5 layers, and after that removing one of the 5 layers, this old layer is still in the javascript array. This is why I want to propose the following change: Old piece of code: for( $i=0; $i< $oMap->numlayers; $i++) { $oLayer = $oMap->getLayer( $i ); $oLayer->setmetadata( "layer_index", $i ); $szLayers .= 'aLayers['.$i.'] = "'.$oLayer->name.'";'."\n"; } New piece of code: $oLayer = $oMap->getLayer( $i ); if ($oLayer->status == MS_DELETE) { } else { $oLayer->setmetadata( "layer_index", $i ); $szLayers .= 'aLayers['.$i.'] = "'.$oLayer->name.'";'."\n"; } Any objections or thoughts?
looks good, please implement.
Fixed in CVS, revision 1.13 of LegendTemplate.widget.php.
I have found an issue with this fix and propose the following now: $icounter = 0; for( $i=0; $i< $oMap->numlayers; $i++) { $oLayer = $oMap->getLayer( $i ); if ($oLayer->status == MS_DELETE) { } else { $oLayer->setmetadata( "layer_index", $icounter ); $szLayers .= 'aLayers['.$icounter.'] = "'.$oLayer->name.'";'."\n"; $icounter++; } }
ok, I see the problem with using $i if you are deleting layers :)
Chanegd target to 1.99 RC 1.
Bart, if you fixed this and have committed it, please close the bug so we can verify it for the release.
Paul, I have just committed my final fix to CVS. Revision 1.19 for LegendTemplate.widget.php. Sorry for leaving this so long. Maybe it would be useful to change the "Assigned To" for this type of bug to me, so there would be less chance of me leaving this so long :), but I probably don't have bugzilla rights to do this.
Bart, I believe that anyone in bugzilla can assign a bug to themselves :) Thanks for getting this in.