I don’t know why, but mapbox does not display geojson polygons on the map. I add markers as symbols in the same way and everything works.
Value geoJsonSourceValue = Value.fromJson(response.body().toString()).getValue();
mapView.getMapboxMap().removeStyleSource("c-source");
if (geoJsonSourceValue != null) {
mapView.getMapboxMap().addStyleSource("c-source", geoJsonSourceValue);
}
String layerJson = "{"
+ ""id": "c-layer","
+ ""type": "line","
+ ""source": "c-source","
+ ""layout": {"
+ "}"
+ "}";
Value layerValue = Value.fromJson(layerJson).getValue();
if (layerValue != null) {
mapView.getMapboxMap().addStyleLayer(layerValue, null);
}