[Mapserver-users] styleObj? member of classObj?

Steve Lime steve.lime at dnr.state.mn.us
Mon Jun 2 18:22:25 PDT 2003


Styles exist within a class, so numbering is sequential but only within
a class. The first style in any class is 0, next is 1 and so on. In the
mapfile styles are defined in the order they are drawn. At this point
styles may not be shared...

Steve

>>> Gerald Buckmaster <gbuckmaster at cox.net> 05/31/03 8:19 PM >>>
Ok, that makes a bit more sense, but I guess it begs more questions from
me.

How do you know which styleObj is index 0?  Would that be the first
styleObj
created within a classObj, ie the first style within the class within a
layer 
within the .map file?  And if that is so, if I create another styleObj
with a 
different variable, does it start over at 0?

Gerald

On Saturday 31 May 2003 02:50 pm, Daniel Morissette wrote:
> Gerald,
>
> You have to call $class->GetStyle( style_index ) to access a given
> style.  And you use ms_newStlyeObj($class) to create a new style
inside
> a class.
>
> <long_story>
> Since there can be more than one style in a class, we cannot present a
> single class member called style like we do for style->label for
> instance.  We would have to present an array of styles, not just a
> single style... I guess we could have tried to do it this way, but
there
> may have been some issues with the PHP wrappers and anyway the
> getStyle() approach was more consistent with the way layers are
accessed
> inside the map, and the way classes are accessed inside layers.
> </long_story>
>
> Daniel
>
> Gerald Buckmaster wrote:
> > Greetings,
> >
> > Trying to understand the 3.7/4.0 documentation in regards to
styleObjs.
> > Reading the info on styleObj class leads me to believe instances of
> > styleObj are always embedded inside the classObj, yet when I look at
the
> > members of the classObj, I don't see it named:
> >
> >  Members:
> >
> >    string name
> >    string title
> >    int    type
> >    int    status      (MS_ON, MS_OFF or MS_DELETE)
> >    int    minscale
> >    int    maxscale
> >    string template
> >    labelObj label
> >    int    numstyles
> >
> > All I see is a member called numstyles and a method called
getStyle().
> >
> > So how do I "attach" a styleObj to a classObj?  Doesn't seem to be
> > consistent, ie the labelObj is named label.
> >
> >         $cityLabel = $cityCls->label; # I understand
> >         $cityStyle = $cityCls->???; # no clue
> >
> > Thanks,
> > Gerald

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list