I'm trying to style markers for points I render in the mapbox component.
What should work here (I think) is to forget using the points option and instead use just the geojson. I see the example geojson that comes with the component and that renders a polygon that you can fill with different colors using "paint" in the geojson styling.
The geojson that should work for just points is like:
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-122.454, 37.766]
},
"properties": {
"marker": "1"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-122.510, 37.764]
},
"properties": {
"marker": "2"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-122.510, 37.772]
},
"properties": {
"marker": "1"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-122.455, 37.773]
},
"properties": {
"marker": "2"
}
}
]
}
And the styling something like:
"paint": {
"circle-radius": 6,
"circle-color": [
"match",
["get", "marker"],
"1", "red",
"2", "green",
"3", "blue",
"4", "yellow",
"grey" // default color
]
}
}
But this doesn't render any points for me. Thoughts on if this is possible or other ways to handle it?