MapBoxTileLayer static method

TileLayer MapBoxTileLayer({
  1. required String accessToken,
  2. MapBoxType type = MapBoxType.Street,
  3. TileLayerOptions? options,
})

Used to load and display tile layers from MapBox servers.

Example:

U.MapBoxLayer(
  type: MapBoxType.Satellite,
  options: TileLayerOptions(
    opacity: 0.9,
  ),
)

@param: accessToken

Your access token to load tiles from MapBox. Required.

@param: type

enum to define the type of MapBox tiles to load. Default value: MapBoxType.Street.

Available values: MapBoxType.Basic MapBoxType.Street MapBoxType.Satellite MapBoxType.Hybrid MapBoxType.Outdoors MapBoxType.Dark MapBoxType.Light MapBoxType.Bright

Implementation

// ignore: non_constant_identifier_names
static L.TileLayer MapBoxTileLayer({
  required String accessToken,
  MapBoxType type = MapBoxType.Street,
  L.TileLayerOptions? options,
}) {
  return L.TileLayer(
    options: mapbox(
      type: type,
      accessToken: accessToken,
      options: options ?? L.TileLayerOptions(),
    ),
  );
}