CartoDBTileLayer static method

TileLayer CartoDBTileLayer({
  1. required CartoDBType type,
  2. TileLayerOptions? options,
})

Used to load and display tile layers from CartoDB servers.

Example:

U.CartoDBTileLayer(
  type: CartoDBType.Positron,
  options: TileLayerOptions(
    opacity: 0.9,
  ),
)

@param: type

enum to define the type of CartoDB Map tiles to load.

Available values: CartoDBType.Positron CartoDBType.PositronNoLabels CartoDBType.PositronOnlyLabels CartoDBType.DarkMatter CartoDBType.DarkMatterNoLabels CartoDBType.DarkMatterOnlyLabels CartoDBType.Voyager CartoDBType.VoyagerNoLabels CartoDBType.VoyagerOnlyLabels CartoDBType.VoyagerLabelsUnder

@param: options

Parameter to override the default value of TileLayerOptions Default value: TileLayerOptions()

Implementation

// ignore: non_constant_identifier_names
static L.TileLayer CartoDBTileLayer({
  required CartoDBType type,
  L.TileLayerOptions? options,
}) {
  return L.TileLayer(
    options: cartodb(
      type: type,
      options: options ?? L.TileLayerOptions(),
    ),
  );
}