[Chameleon-dev] [Bug 664] New: LegendTemplateGetLayerName javascript array contents not always correct

bugzilla-daemon at www.maptools.org bugzilla-daemon at www.maptools.org
Wed Sep 8 08:14:56 EDT 2004


           Summary: LegendTemplateGetLayerName javascript array contents not
                    always correct
           Product: Chameleon
           Version: 1.99
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Widget
        AssignedTo: chameleon-dev at lists.maptools.org
        ReportedBy: bartvde at xs4all.nl

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) { }
              $oLayer->setmetadata( "layer_index", $i );
              $szLayers .= 'aLayers['.$i.'] = "'.$oLayer->name.'";'."\n";

Any objections or thoughts?

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the Chameleon-dev mailing list