[Chameleon-dev] [Bug 1222] Query widget hilite raster fatal error

bugzilla-daemon at bugzilla.maptools.org bugzilla-daemon at bugzilla.maptools.org
Tue Dec 20 13:18:42 EST 2005


http://bugzilla.maptools.org/show_bug.cgi?id=1222





------- Additional Comments From mcgrawj at agr.gc.ca  2005-12-20 13:18 -------
Ah, I see. That's my mistake re: gszQueryLayers being names and not ids.
 
Since I was using the same information somewhere else in my code and wasn't 
using the highlighting then anyway, I had changed that variable to pass in the 
actual layer names instead.

The original code still didn't work properly though; $nCount was undefined and 
I believe the explode syntax was incorrect (can't remember).

So, really the first part of the code should be as follows:
    if ( $szQueryLayers != "?" )
    {
        // get array of layers
        $aszLayers = explode(",", $szQueryLayers );

        // loop and get the name of each layer
        for ( $i=count($aszLayers)-1; $i>-1; $i-- )
        {
            // get layer
            $oLayer = $oMap->getLayer( $aszLayers[$i] );

            if ( $oLayer->type == MS_LAYER_RASTER ){
                // remove the layer from the query
                unset($aszLayers[$i]); 
            } else {
                // update array to be name
                $aszLayers[$i] = $oLayer->name;
            }
        }
    }

Or, alternatively, it could be written to handle being passed an array of 
indices or layer names (which is how I'll have to write my version of 
drawmap.php).
Cheers,
jtm




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


Please do NOT reply to this email, use the link above instead to 
login to bugzilla and submit your comment. Any email reply to this
address will be lost.


More information about the Chameleon-dev mailing list