[GIS] MapBox GL and styling for data driven labels

mapbox-glstyle

I can use the data driven feature to color points, works great

MAP.addLayer({
"id": "schools",
"type": "circle",
"source": "markers",
"layout": { },
"paint": {
    "circle-radius": 8
    'circle-color': {               // for data driven colors need v0.18.0
        'property': 'type',
        'type': 'categorical',
        'stops': [
            ['ELEMENTARY', '#009900'], 
            ['MIDDLE', '#cc00ff'], 
            ['HIGH', '#1666ff'] 
   }
}   
});

I also want the label to be the same color as the point. All my text labels default to the first stop color. Can I use the data driven feature for text labels, and if so what am I doing wrong?

MAP.addLayer({
"id": "school_label",
"type": "symbol",
"source": "markers",
"layout": {
    "text-font": ["Open Sans Regular"],
    "text-field": "{full_name}",
    "symbol-placement": "point",
    "text-size": 10
},
"paint": {
    //"text-color": "#ff0000",
    'text-color': {
        'property': 'type',
        'type': 'categorical',
        'stops': [
            ['ELEMENTARY', '#009900'], 
            ['MIDDLE', '#cc00ff'], 
            ['HIGH', '#1666ff'] 
    }
    }
});   

Best Answer

I just read this in a mapbox blog, and to answer my own question I cannot do data driven labels.
"data driven styles have been one of the biggest tasks in Mapbox GL’s history, but they stand to change everything. Right now we just support data-driven styles for Mapbox GL JS, and only for circle-radius and circle-color."

Related Question