[mapserver-users] Request feature mapscript, Selecting a Class by Name
Daniel Morissette
morissette at dmsolutions.ca
Thu Oct 10 08:10:52 PDT 2002
Tom Myny wrote:
>
> Hi Mapserver users,
>
> Is it possible to select a class by name in a Layer. Something like
> getClassbyname ?
> I use the feature getlayerbyname to select a Layer but for Classes i must
> use an integer :/
> Can this feature be enabled in mapscript ?
>
I filed this in the MapServer bugzilla... if you're lucky it may happen
in 3.7
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=209
In the meantime you can write your own little PHP function that loops
through the layers and compares the $class->name value to locate the
layer you're looking for. But if you use this a lot then it can become
a waste of resources because each call to $layer->getClass() creates a
new instance of PHP classObj wrapper, etc.
Daniel
--
------------------------------------------------------------
Daniel Morissette morissette at dmsolutions.ca
DM Solutions Group http://www.dmsolutions.ca/
------------------------------------------------------------
Don't put for tomorrow what you can do today, because if
you enjoy it today you can do it again tomorrow.
More information about the MapServer-users
mailing list