Making FeatureNode transparent #2511
-
Hi! I'm trying to highlight a FeatureNode by making all other FeatureNodes transparent, All nodes use the following style:
I'm using the following function:
However, this only affects the TextSymbol and not the outline (LineSymbol Stroke) or the fill (PolygonSymbol Fill). Why? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I was not able to reproduce the issue with some test code (here). Are your FeatureNodes under the MapNode in the scene graph? If not, make sure you have the GL_BLEND mode enabled in OSG. (Also, this might be a good use case for a shader instead. See |
Beta Was this translation helpful? Give feedback.
-
@gwaldron Another related question. I'm trying to also make a PlaceNode with an IconSymbol transparent. The IconSymbol is a png loaded from file, that is already transparent in some parts. I'm getting the IconSymbol from the style, then using getImage() to get the underlying Image. I then modify the alpha channel of the data vector in the Image, but the Image is not updated. Just to make sure I'm doing the correct thing I tried setting all pixels to black as instead, but my Icon on the map remains unchanged. How do I get the new Image to show up?
|
Beta Was this translation helpful? Give feedback.
Thanks! After I got it to work with your exact polygon using my highlight function, but not my own polygons I discovered that I had applied my Basic_Polygon_Style to the Feature, not the FeatureNode. So after removing the style completely from the Feature and instead applying it to the FeatureNode I got it to work. I was modifying the wrong style.