flutter-mapbox-gl / maps

A Mapbox GL flutter package for creating custom maps
Other
1.04k stars 503 forks source link

Unable to find layers id of layers that have been added #1392

Closed aardrop closed 7 months ago

aardrop commented 10 months ago

Is there a way to read what layers and sources have been added from the controller?

I have the below running but the layers returning from any of the managers don't contain the layer I'm adding.

await mapController.addFillLayer(
      "polygons",
      "layerIdTest",
      FillLayerProperties(
        fillColor: [
          "interpolate",
          ["linear"],
          ["zoom"],
          0,
          "hsl(139, 43%, 21%)",
          22,
          "#1f4e2e"
        ],
        fillOpacity: 0.1,
        fillOutlineColor: "#D10000",
      ),
      filter: [
        "match",
        ["get", "location_type_id"],
        ["Test"],
        true,
        false
      ],
      sourceLayer: "default",
    );

    StackTrace.current.printWithInfo('Map Fill Manager Layer Ids: ${mapController.fillManager?.layerIds}');

The layer is adding to the map fine but I can't programmatically check the layer ids that I've add

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.