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
- Available extensions
- 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
- pZero → Widget
-
Available on Widget, provided by the WidgetsExtension extension
no setter -
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
- sliverBox → Widget
-
Available on Widget, provided by the WidgetSliverBoxX extension
no setter -
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
-
alignAtBottomCenter(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtBottomLeft(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtBottomRight(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtCenter(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtCenterLeft(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtCenterRight(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtLERP(
Alignment a, Alignment b, double t, {Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtTopCenter(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtTopLeft(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignAtTopRight(
{Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
alignXY(
double x, double y, {Key? key, double? heightFactor, double? widthFactor}) → Align -
Available on Widget, provided by the WidgetsExtension extension
-
card(
{Color? backgroundColor, double elevation = 1, EdgeInsets? margin}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
container(
{double? width, double? height, Alignment? alignment, Color? backgroundColor, double borderWidth = 1, double radius = 1, Color borderColor = Colors.transparent, EdgeInsets? padding, EdgeInsets? margin, BoxConstraints? constraints}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
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
-
expanded(
{int flex = 1}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
fit(
{Alignment alignment = Alignment.center}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
form(
GlobalKey< FormState> key) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
ltr(
) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDoubleTap(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
onLongPress(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
onTap(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
onTapInk(
GestureTapCallback? onPressed) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
pAll(
double padding) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
pOnly(
{double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
pSymmetric(
{double horizontal = 0.0, double vertical = 0.0}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
rotate(
double scale) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
rtl(
) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
safeArea(
) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
scale(
double scale) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
scrollable(
{Axis scrollDirection = Axis.vertical}) → Widget -
Available on Widget, provided by the WidgetsExtension extension
-
showMenus(
List< PopupMenuEntry< items) → Widgetint> > -
Available on Widget, provided by the WidgetsExtension extension
-
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
-
translate(
Offset offset) → Widget -
Available on Widget, provided by the WidgetsExtension extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited