maplibre/flutter-maplibre-gl

AddSource with a GeometryCollection

imerzi opened this issue · 3 comments

Hi, i am trying to add a source with a GeometryCollection but it's not really working.

GeometryCollection is not supported yet ?

static Future<void> _drawGeomData(IsarLayer layer, MaplibreMapController mapController, WidgetRef ref) async {
    await mapController.addSource(
      layer.id,
      GeojsonSourceProperties(
        data: layer.geom?.toMap(),
      ),
    );

    await MapService.addLayerStyle(layer.style, layer.id, mapController);
  }

JNI DETECTED ERROR IN APPLICATION: can't call java.lang.Object[] java.util.List.toArray() on null object

Here is an example of data passed:

{bbox: [-0.5712632536888123, 44.860328674316406, -0.5360799431800842, 44.86923599243164], geometries: [{coordinates: [-0.571263257, 44.86433784], type: Point}, {coordinates: [-0.556603536, 44.869236012], type: Point}, {coordinates: [-0.536079926, 44.860329935], type: Point}], type: GeometryCollection}

I think it should be supported by the underlying MapLibre native libraries. Can you share some stacktrace or do you see more error messages that would allow us to hunt down the specific line where the error occurs?