1

I'm new to Mapbox and I am trying to remove any color in my polygon fill using the Mapbox API. Note: I don't want to set opacity/transparency. I simply want there to be no color. It keeps defaulting to "#000000", even if I comment out the 'fill-color' property. Is there any way to achieve this?

 map.addLayer({
            'id': 'us-states',
            'type': 'fill',
            'source': 'us-states',
            'layout': {},
            'paint': {
                //'fill-color': '#333',
                'fill-opacity': 0.8,
                'fill-outline-color': '#000'
            }
    }) 
1
  • 1
    Could you point to some image that has the color that you would like to get? Totally transparent is the only no-color that comes into my mind but obviously you have something else in your mind.
    – user30184
    Commented Mar 9, 2021 at 21:32

1 Answer 1

4

I got this to work with:

'paint': {
            'fill-color': 'transparent',
            'fill-opacity': 1.0
        }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.