[mapserver-dev] Re: PHP_MapScript - set opacity of a styleObj
Mike Leahy
mgleahy at alumni.uwaterloo.ca
Wed Aug 27 02:18:11 EDT 2008
Hello again,
I think I answered my own question. In php_mapscript.c, I made the
following changes:
- In _phpms_build_style_object, I added this:
add_property_long(return_value, "opacity", pstyle->opacity);
- And in php3_ms_style_setProperty, I added this:
else IF_SET_LONG( "opacity", self->opacity)
I recompiled mapserver, and it works - at least I think (i.e., no errors
when I set the property, and everything else is working as it did)...I
still have to get the code I'm working on to render some output.
Do these changes look okay?
Mike
Mike Leahy wrote:
> Hello devs,
>
> I'm just wondering if I'm missing anything (since the online
> documentation claims to be out-of-date). I'm trying to create a new
> layer in a PHP_MapScript map object that has opacity set in a styleObj.
> But when I execute $oStyle->set("opacity",50), I get an error message
> saying "Property 'opacity' does not exist in this object.". The same
> happens for transparency. Is there a different way I should be doing this?
>
> Since style-level opacity is a new feature, I'm guessing it hasn't made
> its way into mapscript yet? If that is the case, what would be needed
> to add this, and/or is there a workaround I that can use instead? The
> only alternative I can imagine at this point is to save the map object
> to a temporary mapfile, write the new layers as text in the mapfile,
> then read it back into a new map object. Is that my best option?
>
> Thanks for any suggestions,
> Mike
>
More information about the mapserver-dev
mailing list