TileLayer 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
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- TileLayer
- Annotations
Constructors
-
TileLayer.new({Key? key, String? urlTemplate, String? fallbackUrl, @Deprecated('`tileSize` is deprecated. Use `tileDimension` instead.') double? tileSize, int tileDimension = 256, double minZoom = 0, double maxZoom = double.infinity, int minNativeZoom = 0, int maxNativeZoom = 19, bool zoomReverse = false, double zoomOffset = 0.0, Map<
String, String> additionalOptions = const {}, List<String> subdomains = const ['a', 'b', 'c'], int keepBuffer = 2, int panBuffer = 1, ImageProvider<Object> ? errorImage, TileProvider? tileProvider, bool tms = false, WMSTileLayerOptions? wmsOptions, TileDisplay tileDisplay = const TileDisplay.fadeIn(), bool? retinaMode, ErrorTileCallBack? errorTileCallback, TileBuilder? tileBuilder, EvictErrorTileStrategy evictErrorTileStrategy = EvictErrorTileStrategy.none, Stream<void> ? reset, LatLngBounds? tileBounds, TileUpdateTransformer? tileUpdateTransformer, String userAgentPackageName = 'unknown'}) - Create a new TileLayer for the FlutterMap widget.
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
-
errorImage
→ ImageProvider<
Object> ? -
Tile image to show in place of the tile that failed to load.
final
- errorTileCallback → ErrorTileCallBack?
-
This callback will be executed if an error occurs when fetching tiles.
final
- evictErrorTileStrategy → EvictErrorTileStrategy
-
If a Tile was loaded with error and if strategy isn't
none
then TileProvider will be asked to evict Image based on current strategy (see #576 - even Error Images are cached in flutter)final - fallbackUrl → String?
-
Fallback URL template, used if an error occurs when fetching tiles from
the urlTemplate.
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?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxNativeZoom ↔ int
-
Maximum zoom number supported by the tile source has available.
latefinal
- maxZoom ↔ double
-
The maximum zoom level up to which this layer will be displayed
(inclusive).
latefinal
- minNativeZoom ↔ int
-
Minimum zoom level supported by the tile source
latefinal
- minZoom ↔ double
-
The minimum zoom level down to which this layer will be displayed
(inclusive)
latefinal
- panBuffer → int
-
When loading tiles only visible tiles are loaded by default. This option
increases the loaded tiles by the given number on both axis which can help
prevent the user from seeing loading tiles whilst panning. Setting the
pan buffer too high can impact performance, typically this is set to zero
or one.
final
-
reset
→ Stream<
void> ? -
Stream to notify the TileLayer that it needs resetting
final
- resolvedRetinaMode ↔ RetinaMode
-
Resolved retina mode, based on the
retinaMode
passed in the constructor and the urlTemplatelatefinal - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
subdomains
→ List<
String> -
List of subdomains for the URL.
final
- tileBounds → LatLngBounds?
-
Only load tiles that are within these bounds
final
- tileBuilder → TileBuilder?
-
Function which may Wrap Tile with custom Widget
There are predefined examples in 'tile_builder.dart'
final
- tileDimension ↔ int
-
Size in pixels of each tile image
latefinal
- tileDisplay → TileDisplay
-
Control how tiles are displayed and whether they are faded in when loaded.
Defaults to TileDisplay.fadeIn().
final
- tileProvider ↔ TileProvider
-
Provider with which to load map tiles
latefinal
- tileSize ↔ double?
-
Size in pixels of each tile image
latefinal
- tileUpdateTransformer → TileUpdateTransformer
-
Restricts and limits TileUpdateEvents (which are emitted 'by'
MapEvents), which cause tiles to update.
final
- tms → bool
-
If
true
, inverses Y axis numbering for tiles (turn this on for TMS services).final - urlTemplate → String?
-
The URL template is a string that contains placeholders, which, when filled
in, create a URL/URI to a specific tile.
final
- wmsOptions → WMSTileLayerOptions?
-
If not
null
, then tiles will pull's WMS protocol requestsfinal - zoomOffset ↔ double
-
The zoom number used in tile URLs will be offset with this value.
latefinal
- zoomReverse → bool
-
If set to true, the zoom number used in tile URLs will be reversed
(
maxZoom - zoom
instead ofzoom
)final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StatefulWidget> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited