MapTools.org

[maplab-users] Querying different layers/adding classes

William A. Bronsema, C.E.T. bronsema@dmsolutions.ca
Thu, 12 Jun 2003 12:58:58 -0400
Mike,

Setting the template value to "" will be sufficient for it not to be 
queried.  Something like:

$oLayer->set( "template", "" );

Aside from physically deleting it from the mapfile, I don't think there 
is a way to delete the entire TEMPLATE property.

For classes check out 
http://mapserver.gis.umn.edu/doc36/phpmapscript-class-guide.html#ClassObj

To create a new class try something like:
$oClass = ms_newClassObj( $oLayer );

To delete a class set it's status to MS_DELETE:
$oClass->set( "status", MS_DELETE );

In the next save operation the class will be gone.

Hope this helps.



Regards,
Bill

-- 
William A. Bronsema, C.E.T.
Applications Developer
DM Solutions Group Inc.

http://www.dmsolutions.ca
e-mail: bronsema@dmsolutions.ca
phone : +1 (613) 565-5056 ext.25
fax   : +1 (613) 565-0925
_______________________________________________


Mike Leahy wrote:
> Hello all again,
> 
>  
> 
> I have two questions.  Regarding my previous post, I found in the MapScript
> class guide that queries are performed on all layers with a value specified
> for the template in the layer object.  So if I remove the TEMPLATE property
> in the mapfile, objects in that layer won't be highlighted in the query.  So
> now my question is, can I actually *remove* a property from a layer object?
> There is the $oLayer->set( property_name, property_value ); function - if I
> supply a null value, does that remove the whole property, or just give it an
> empty string (which would still cause the objects to be highlighted in the
> image).
> 
>  
> 
> My next question is related to adding/removing classes to a layer -
> essentially, how do I do it?  The class reference discusses how to create a
> new class, but not how to add or remove them from a layer.  Are there any
> reference that discuss this at all?
> 
>  
> 
> BTW: My colleague and I are volunteering for an NGO in Peru, and have little
> access to technical resources.  I hope the members of this list can forgive
> the numerous posts I have been making, as I climb up a fairly seep learning
> curve.
> 
>  
> 
> Many thanks,
> 
> Mike






This archive was generated by Pipermail.