Add opacity to geojson

I would like to change the default opacity of the polygons that I’m plotting on a map. I tried to add fill-opacity to the properties, but that doesn’t seem the have any effect. Is there another way to do this?

This is an example of a feature in the geojson. The property fill does have an effect, but fill-opacity does not.

{
    'geometry': {'coordinates': coordinates, 'type': polygon_type},
    'properties': {
        'description': 'example description',
        'fill': '#000000',
        'fill-opacity': 0.9,
    },
    'type': 'Feature',
}

Hi Floris,

It seems that this feature is currently not supported. I do see that this has been reported, so I will add your case to the reported case. We will keep you posted on the developments of this feature.

I will also change the current category of this post to “Feature Requests”.

1 Like

In case anyone is facing the same issue: our current workaround right now is to add a geometry multiple times to increase the perceived opacity.

Hi Floris,

With the latest platform release it should be possible to use the fill-opacity in your geojson definition directly: Results & visualizations - Map | VIKTOR Documentation.

3 Likes