-
-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C# Mapscript problem setting opacity on style object #4153
Comments
Author: woodbri |
attachment http://trac.osgeo.org/mapserver/attachment/ticket/4153/Stepping.png :
|
attachment http://trac.osgeo.org/mapserver/attachment/ticket/4153/ms-bug-4153.zip :
|
Currently mapserver doesn't support setting alpha values for the color attributes, and alpha values are not written back to the mapfile. Setting the opacity value will override the style level color alpha values programatically. |
@tbonfort @dmorissette Could you provide further info how the opacity values should be handled or we can close this one? |
reassigining |
This is an automated commentThis issue has been closed due to lack of activity. This doesn't mean the issue is invalid, it simply got no attention within the last year. Please reopen with missing/relevant information if still valid. Typically, issues fall in this state for one of the following reasons:
|
Reporter: woodbri
Date: 2012/01/11 - 15:38
Trac URL: http://trac.osgeo.org/mapserver/ticket/4153
The mapfile STYLE block[1] has OPACITY [integer|attribute] but I do not see this attribute listed in the SWIG mapscript [2] styleObj Attributes list.
And I have a report that when trying to use this via .NET mapscript that it does not seem to work.
layerObj opacity seems to work just fine.
If I go the
my_style.opacity = 50
route, it looks like it's being completely ignored in the resulting map.
If I go the
my_style.updateFromString("STYLE OPACITY 50 END")
route, then this also is sometimes ignored. It is ignored if after having set the opacity I set the color with
my_style.color = New colorObj(0, 255, 0, 0)
but if I rearrange my statements such that the color is set before instead of after I set the opacity (opacity set with updateFromString) then all works just fine. The other properties I set (symbol, width, outlinecolor) don't seem to have any similar order dependency as the transparency works just fine with them occurring either before or after the updateFromString call.
Stepping through the following snippet of code
(see attached Stepping.png image for the below)
After the first .color = line, the alpha for color is set to 255.
After the .opacity = line, the alpha for color is still 255.
After the .updateFromString line, the alpha for color is 127 or approximately 50%.
After the second .color = line, the alpha for color is back at 255.
The .outlinecolor.alpha is always 255 and doesn't seem to affect the eventual appearance of the map, rather the outline is opaque if color.alpha = 255 but semi-transparent if color.alpha is less than 255.
So, if I had to guess as to what's going on under the covers I'd guess that style.alpha is being completely ignored and color.alpha is dictating the transparency of both the fill and the outline.
Testing using MS4W version 3.0.3 which I believe would be MapServer 6.0.1. 32-bit version.
The text was updated successfully, but these errors were encountered: