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']
}
}
});