[Mapserver-users] styleObj? member of classObj?

Daniel Morissette morissette at dmsolutions.ca
Sat May 31 17:50:17 EDT 2003


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
>



More information about the mapserver-users mailing list