Currently, I am manually setting the stops but my GeoJSON files have different ranges and I have to set stops values every time. Is it possible to use min and max value of a property within a map.addLayer function? and then divide it into a range of values? I am currently parsing the GeoJSON to get minimum and maximum value and I am not sure if mapbox provides this functionality.
map.addLayer({
'id': 'heatmap',
'type': 'circle',
'source': "sourceGeoJSON",
paint: {
'circle-color': {
property:'pH',
stops: [
[6,'#6879FB'],
[8,'#68FB75'],
[9, '#F94B18'],
[10, '#F92918']
];
},
'circle-opacity': 1.0
}
});