TileLayerOptions class

Describes the needed properties to create a tile-based layer. A tile is an image bound to a specific geographical position.

You should read up about the options by exploring each one, or visiting https://docs.fleaflet.dev/usage/layers/tile-layer. Some are important to avoid issues.

Inheritance

Constructors

TileLayerOptions({Key? key, String? urlTemplate, double tileSize = 256.0, double minZoom = 0.0, double maxZoom = 18.0, double? minNativeZoom, double? maxNativeZoom, bool zoomReverse = false, double zoomOffset = 0.0, Map<String, String>? additionalOptions, List<String> subdomains = const <String>[], int keepBuffer = 2, Color backgroundColor = const Color(0xFFE0E0E0), ImageProvider<Object>? errorImage, TileProvider? tileProvider, bool tms = false, WMSTileLayerOptions? wmsOptions, double opacity = 1.0, Duration updateInterval = const Duration(milliseconds: 200), Duration tileFadeInDuration = const Duration(milliseconds: 100), double tileFadeInStart = 0.0, double tileFadeInStartWhenOverride = 0.0, bool overrideTilesWhenUrlChanges = false, bool retinaMode = false, ErrorTileCallBack? errorTileCallback, Stream<void>? rebuild, TemplateFunction templateFunction = util.template, TileBuilder? tileBuilder, TilesContainerBuilder? tilesContainerBuilder, EvictErrorTileStrategy evictErrorTileStrategy = EvictErrorTileStrategy.none, bool fastReplace = false, Stream<void>? reset, LatLngBounds? tileBounds, String userAgentPackageName = 'unknown'})

Properties

additionalOptions Map<String, String>
Static information that should replace placeholders in the urlTemplate. Applying API keys is a good example on how to use this parameter.
final
backgroundColor Color
Color shown behind the tiles
final
errorImage ImageProvider<Object>?
Tile image to show in place of the tile that failed to load.
final
errorTileCallback ErrorTileCallBack?
This callback will be execute if some errors occur when fetching tiles.
final
evictErrorTileStrategy EvictErrorTileStrategy
final
fastReplace bool
This option is useful when you have a transparent layer: rather than keeping the old layer visible when zooming (resulting in both layers being temporarily visible), the old layer is removed as quickly as possible when this is set to true (default false).
final
hashCode int
The hash code for this object.
no setterinherited
keepBuffer int
When panning the map, keep this many rows and columns of tiles before unloading them.
final
key Key?
finalinherited
maxNativeZoom double?
Maximum zoom number the tile source has available. If it is specified, the tiles on all zoom levels higher than maxNativeZoom will be loaded from maxNativeZoom level and auto-scaled.
final
maxZoom double
The maximum zoom level up to which this layer will be displayed (inclusive). In most tile providers goes from 0 to 19.
final
minNativeZoom double?
Minimum zoom number the tile source has available. If it is specified, the tiles on all zoom levels lower than minNativeZoom will be loaded from minNativeZoom level and auto-scaled.
final
minZoom double
final
opacity double
Opacity of the rendered tile
final
overrideTilesWhenUrlChanges bool
false: current Tiles will be first dropped and then reload via new url (default) true: current Tiles will be visible until new ones aren't loaded (new Tiles are loaded independently) @see https://github.com/johnpryan/flutter_map/issues/583
final
rebuild Stream<void>?
finalinherited
reset Stream<void>?
Stream to notify the TileLayer that it needs resetting
getter/setter pair
retinaMode bool
If true, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subdomains List<String>
List of subdomains for the URL.
final
templateFunction TemplateFunction
final
tileBounds LatLngBounds?
Only load tiles that are within these bounds
getter/setter pair
tileBuilder TileBuilder?
Function which may Wrap Tile with custom Widget There are predefined examples in 'tile_builder.dart'
final
tileFadeInDuration Duration?
Tiles fade in duration in milliseconds (default 100). This can be null to avoid fade in.
final
tileFadeInStart double
Opacity start value when Tile starts fade in (0.0 - 1.0) Takes effect if tileFadeInDuration is not null
final
tileFadeInStartWhenOverride double
Opacity start value when an exists Tile starts fade in with different Url (0.0 - 1.0) Takes effect when tileFadeInDuration is not null and if overrideTilesWhenUrlChanges if true
final
tileProvider TileProvider
Provider with which to load map tiles
latefinal
tilesContainerBuilder TilesContainerBuilder?
Function which may wrap Tiles Container with custom Widget There are predefined examples in 'tile_builder.dart'
final
tileSize double
Size for the tile. Default is 256
final
tms bool
If true, inverses Y axis numbering for tiles (turn this on for TMS services).
final
updateInterval Duration?
Tiles will not update more than once every updateInterval (default 200 milliseconds) when panning. It can be null (but it will calculating for loading tiles every frame when panning / zooming, flutter is fast) This can save some fps and even bandwidth (ie. when fast panning / animating between long distances in short time)
final
urlTemplate String?
Defines the structure to create the URLs for the tiles. {s} means one of the available subdomains (can be omitted) {z} zoom level {x} and {y} — tile coordinates {r} can be used to add "@2x" to the URL to load retina tiles (can be omitted)
final
wmsOptions WMSTileLayerOptions?
If not null, then tiles will pull's WMS protocol requests
final
zoomOffset double
The zoom number used in tile URLs will be offset with this value.
final
zoomReverse bool
If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited