[Chameleon] Querying a dynamic layer

Ken-ichi kueda at wso.williams.edu
Tue Sep 21 19:13:34 EDT 2004


Hi all.  I'm having trouble using the QueryWidget on a shapefile that 
I've added to the map dynamically with my own widget.  Basically, I set 
the template property of the layer when I add it to the map, along with 
the tolerance, but when I click on the points in the layer, the popup 
lists no results.  Any idea what's happening?  Here's the code for 
adding the layer, followed by the widget tag I'm using:

$lyrPoints = ms_newLayerObj( $map );
$lyrPoints->set( "name", $quad[0]." Points" );
$lyrPoints->set( "type", MS_SHAPE_POINT );
$lyrPoints->set( "status", MS_ON );
$lyrPoints->set( "data", "/path/to/data" );
$lyrPoints->set( "group", "Your Layers");
$lyrPoints->set( "labelitem", "pointid" );
$lyrPoints->set( "labelmaxscale", "600000" );
$lyrPoints->set( "template", "ttt" );
$lyrPoints->set( "tolerance", 5 );
$lyrPoints->set( "toleranceunits", "pixels" );


<cwc2 type="Query" visible="true" imagetip="Identify Feature" 
PopupWidth="500" PopupHeight="600" Toolbar="false" Status="false" 
Menubar="false" RADIUS="20" MAXFEATURES="5" image="icons/icon_query.png" 
toolset="Navigation" styleresource="NavButtons" 
popupstyleresource="TextButtons">
        <image state="normal"/>
        <image state="hover"/>
        <image state="selected"/>
</cwc2>

The query widget seems to work fine when I just include the same layer 
in the mapfile, so I'm not quite sure what's wrong.

-Ken-ichi



More information about the Chameleon mailing list