MapTools.org

[maplab-users] Querying different layers/adding classes

Mike Leahy mgleahy@fes.uwaterloo.ca
Thu, 12 Jun 2003 14:44:07 -0500
Thanks William,

Regarding the template, using set("template", "") and even
set("template", null) doesn't seem to make a difference.  As long as the
TEMPLATE property exists for the layer, it's objects will be highlighted
in the queried image.  The only solution I see is to not have the
TEMPLATE property in the MapFile.  The small problem that I see here is
that once I add the template property to a layer to make it active for
querying, I can't remove the property...perhaps there is some kind of
workaround, or maybe this will be an option in future versions of
MapScript?

Mike



-----Original Message-----
From: maplab-users-admin@dmsolutions.ca
[mailto:maplab-users-admin@dmsolutions.ca] On Behalf Of William A.
Bronsema, C.E.T.
Sent: June 12, 2003 11:59 AM
To: Mike Leahy
Cc: maplab-users@dmsolutions.ca
Subject: Re: [maplab-users] Querying different layers/adding classes

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#ClassOb
j

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




_______________________________________________
Maplab-users mailing list
Maplab-users@dmsolutions.ca
http://lists.dmsolutions.ca/mailman/listinfo/maplab-users



This archive was generated by Pipermail.