kelly
kelly

Reputation: 1

Mapbox GL JS categorical color classification of strings?

Trying to set a color scheme for different categories of water facilities using step and get expressions, but nothing is showing up on the map.

    map.addLayer({
        'id': 'cool-spaces',
        'type': 'circle',
        'source': 'cspaces-data',
        'paint': {
            'circle-radius': 4,
            'circle-color': [
                'step', 
                ['get', 'locationCode'],
                '#800026',
                'POOL', '#bd0026',
                'SPLASHPAD', '#e31a1c',
                'WADING POOL', '#fc4e2a'
            ]
        },

Tried this code, tried changing the hex code to color strings ('black', 'yellow', etc.), none of them showed up in the map.

Upvotes: 0

Views: 30

Answers (0)

Related Questions