maplibre / flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
https://pub.dev/packages/maplibre_gl
Other
186 stars 106 forks source link

AddSource with a GeometryCollection #383

Open imerzi opened 4 months ago

imerzi commented 4 months ago

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

imerzi commented 4 months ago

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}

m0nac0 commented 4 months ago

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?