[mapserver-dev] Re: PHP_MapScript - set opacity of a styleObj

Yewondwossen Assefa yassefa at dmsolutions.ca
Wed Aug 27 09:29:41 EDT 2008

It is committed in svn.  Online docs are updated to reflect this.
Note that the opacity parameter is only supported with the AGG output.

Best Regards,

Yewondwossen Assefa wrote:
> Mike,
>  I have opened http://trac.osgeo.org/mapserver/ticket/2755 and I will 
> commit your changes.
> Best Regards,
> Mike Leahy wrote:
>> 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
>> _______________________________________________
>> mapserver-dev mailing list
>> mapserver-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev

Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925

More information about the mapserver-dev mailing list