t×tecexpressby TeKOcloud
DEv0.7.1
Files & maps / FLUTTER

TxMap.

Interactive preview

Demo: Synthetic local example tiles, no real geographic data.

Map with pan/zoom, markers and route lines. Without tileUrl the background is neutral; the application configures sources and attribution.

TxMap

ParameterTypeDefaultMeaning
centerTxCoordinateconst TxCoordinate(52.52, 13.405)Geographic map center.
zoomint5Map zoom level.
minZoomint1Minimum zoom level.
maxZoomint19Maximum zoom level.
tileUrlString?nullTile URL with {z}/{x}/{y} placeholders.
attributionString?nullMap provider attribution/license text.
markersList<TxMapMarker>const []Map markers to display.
dataSourceObject?nullList, configuration or DataSource instance; takes precedence over items.
routesList<TxMapRoute>const []Route lines to display.
routeDataSourceObject?nullSeparate data source for route lines.
onCenterChangedValueChanged<TxCoordinate>?nullReports center; update controlled state in the callback.
onZoomChangedValueChanged<int>?nullReports zoom; update controlled state in the callback.
onMarkerClickValueChanged<TxMapMarker>?nullActivated TxMapMarker.
heightdouble360Height; Vue numbers use pixels, Flutter uses logical pixels.
disabledboolfalseDisables interaction.
dart
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:tecexpress/tecexpress.dart';

Widget example() {

  return TxMap(tileUrl: kIsWeb ? Uri.base.resolve('/tiles/demo.png?z={z}&x={x}&y={y}').toString().replaceAll('%7B', '{').replaceAll('%7D', '}') : null, attribution: 'tecexpress · Synthetic demo tiles', markers: [TxMapMarker(52.52, 13.405, id: 'berlin', text: 'Berlin')]);
}