mapbox / mapbox-maps-flutter

Interactive, thoroughly customizable maps for Flutter powered by Mapbox Maps SDK
https://www.mapbox.com/mobile-maps-sdk
Other
284 stars 117 forks source link

Symbols not showing on Map when offline #725

Open brandon-watkins-avcrm opened 3 weeks ago

brandon-watkins-avcrm commented 3 weeks ago

I have a map where I add a symbol layer like so:

    await mapboxMap.style.addLayer(
      SymbolLayer(
        id: '${zone.id}_symbol_layer',
        sourceId: geoJsonSourceId,
        textField: zone.name,
        textColor: Colors.black.value,
        textHaloColor: Colors.white.value,
        textHaloWidth: 3,
        textSize: 18,
        symbolSortKey: 10, 
      ),
    );

I also then add symbols via the PointAnnotationManager when a user selects a point on the map:

 final bytes =
          await rootBundle.load('assets/images/default_map_marker.png');

      final list = bytes.buffer.asUint8List();

      final pointAnnotation = await pointAnnotationManager.create(
        PointAnnotationOptions(
          geometry: Point(coordinates: Position(lng, lat)),
          textField: numWildlife.toString(),
          textOffset: [0.0, 0.0],
          textColor: Colors.black.value,
          textHaloColor: Colors.white.value,
          textHaloWidth: 3,
          textSize: 18,
          iconSize: 3,
          iconOffset: [0.0, -5.0],
          symbolSortKey: 10,
          image: list,
        ),
      );

      return pointAnnotation.id;

Online all of this works as expected. However when offline (I have downloaded the map tiles successfully) the symbols are not showing. Other Line and Fill layers are showing as expected however. When calling pointAnnotationManager.create a pointAnnotation is being returned successfully and no errors are being thrown.

brandon-watkins-avcrm commented 1 week ago

Any updates here?