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
Constructors
-
TileLayer({Key? key, String? urlTemplate, String? fallbackUrl, double tileSize = 256.0, double minZoom = 0.0, double maxZoom = 18.0, int? minNativeZoom, int? maxNativeZoom, bool zoomReverse = false, double zoomOffset = 0.0, Map<
String, String>? additionalOptions, List< String> subdomains = const <String>[], int keepBuffer = 2, int panBuffer = 0, Color backgroundColor = const Color(0xFFE0E0E0), ImageProvider< Object>? errorImage, TileProvider? tileProvider, bool tms = false, WMSTileLayerOptions? wmsOptions, TileDisplay tileDisplay = const TileDisplay.fadeIn(), bool retinaMode = false, ErrorTileCallBack? errorTileCallback, TemplateFunction templateFunction = util.template, TileBuilder? tileBuilder, EvictErrorTileStrategy evictErrorTileStrategy = EvictErrorTileStrategy.none, Stream< void>? reset, LatLngBounds? tileBounds, TileUpdateTransformer? tileUpdateTransformer, 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 executed if an error occurs when fetching tiles.
final
- evictErrorTileStrategy → EvictErrorTileStrategy
-
final
- fallbackUrl → String?
-
Follows the same structure as urlTemplate. If specified, this URL is
used only if an error occurs when loading the urlTemplate.
final
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- 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 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 → int?
-
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
- panBuffer → int
-
When panning the map, extend the tilerange by this many tiles in each
direction.
Will cause extra tile loads, and impact performance.
Be careful increasing this beyond 0 or 1.
final
-
reset
→ Stream<
void>? -
Stream to notify the TileLayer that it needs resetting
final
- 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.
read-onlyinherited
-
subdomains
→ List<
String> -
List of subdomains for the URL.
final
- templateFunction → TemplateFunction
-
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
- tileDisplay → TileDisplay
-
final
- tileProvider → TileProvider
-
Provider with which to load map tiles
final
- tileSize → double
-
Size for the tile.
Default is 256
final
- tileUpdateTransformer → TileUpdateTransformer
-
This transformer modifies how/when tile updates and pruning are triggered
based on MapEvents. It is a StreamTransformer and therefore it is
possible to filter/modify/throttle the
TileUpdateEvent
s. Defaults to TileUpdateTransformers.ignoreTapEvents which disables loading/pruning for map taps, secondary taps and long presses. See TileUpdateTransformers for more transformer presets or implement your own.final - tms → bool
-
If
true
, inverses Y axis numbering for tiles (turn this on for TMS services).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 requestsfinal - 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 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}) → 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