Mapscript and dynamic charting capability

Daniel Morissette dmorissette at MAPGEARS.COM
Wed Jan 23 10:06:32 EST 2008


Sylvain Perrinel wrote:
> 
> But I've a problem with the keyword 'SIZE' in the style properties. You can
> put for this parameter an attribute of your layer  like : SIZE [attribute].
> However, the parameter "size" in phpmascript is defined as a long, not a
> string. So, mapscript does not want to write the parameter SIZE in the mapfile.
> 

You need to use $style->setBinding(MS_STYLE_BINDING_SIZE, 'attribute') 
to bind the size to an attribute.

The PHP MapScript docs on the website haven't been updated with those 
new methods added in 5.0 yet so I have added a comment in the docs about 
them at:

http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/classes/styleobj



    int setBinding(const stylebinding, string value)
        Set the attribute binding for a specfiled style property. 
Returns true on success.

         Example:
            $oStyle->setbinding(MS_STYLE_BINDING_COLOR, "FIELD_NAME_COLOR");
            This would bind the color parameter with the data (ie will 
extract
            the value of the color from the field called "FIELD_NAME_COLOR"

    int removeBinding(const stylebinding)
         Remove the attribute binding for a specfiled style property. 
Returns true on success.
         Example:
            $oStyle->removebinding(MS_STYLE_BINDING_COLOR);


Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the mapserver-users mailing list