Open ilyosbekkk opened 1 year ago
You can create a source using the geojson:
mapboxMap.style.addSource(GeoJsonSource(id: 'myPolygons', data: jsonEncode(myGeoJson)));
mapboxMap.style.addLayer(FillLayer(id: 'polys', sourceId: 'myPolygons', fillColor: 0xff0000));
@asianrider, that didn't work for me, at least not for a list. What class is your "myGeoJson" for your polygons? In the examples on the project, they are adding single objects like LineString but no collections of objects or multiple ones, so there are no examples of this that I can find.
I am trying to draw polygons on the map and in example section of this repository polygons are drawn using Polygon annotations. I fetch geoJson from backend, so is there any ways to draw polygons right from this geoJson without using annotations?