AMapWidget class

用于展示高德地图的Widget

Inheritance

Constructors

AMapWidget({Key? key, CameraPosition initialCameraPosition = const CameraPosition(target: LatLng(39.909187, 116.397451), zoom: 10), MapType mapType = MapType.normal, bool buildingsEnabled = true, bool compassEnabled = false, bool labelsEnabled = true, LatLngBounds? limitBounds, MinMaxZoomPreference? minMaxZoomPreference, bool rotateGesturesEnabled = true, bool scaleEnabled = true, bool scrollGesturesEnabled = true, bool tiltGesturesEnabled = true, bool touchPoiEnabled = true, bool trafficEnabled = false, bool zoomGesturesEnabled = true, MapCreatedCallback? onMapCreated, Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{}, CustomStyleOptions? customStyleOptions, MyLocationStyleOptions? myLocationStyleOptions, ArgumentCallback<CameraPosition>? onCameraMove, ArgumentCallback<CameraPosition>? onCameraMoveEnd, ArgumentCallback<AMapLocation>? onLocationChanged, ArgumentCallback<LatLng>? onTap, ArgumentCallback<LatLng>? onLongPress, ArgumentCallback<AMapPoi>? onPoiTouched, Set<Marker> markers = const <Marker>{}, Set<Polyline> polylines = const <Polyline>{}, Set<Polygon> polygons = const <Polygon>{}, List<AMapExtension> extensions = const []})
创建一个展示高德地图的widget
const

Properties

buildingsEnabled bool
是否显示3D建筑物,默认显示
final
compassEnabled bool
是否显示指南针
final
customStyleOptions CustomStyleOptions?
自定义地图样式
final
extensions List<AMapExtension>
final
gestureRecognizers Set<Factory<OneSequenceGestureRecognizer>>
需要应用到地图上的手势集合
final
hashCode int
The hash code for this object.
no setterinherited
initialCameraPosition CameraPosition
初始化时的地图中心点
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelsEnabled bool
是否显示底图文字标注
final
limitBounds → LatLngBounds?
地图显示范围
final
mapType MapType
地图类型
final
markers Set<Marker>
地图上显示的Marker
final
minMaxZoomPreference MinMaxZoomPreference?
缩放级别范围
final
myLocationStyleOptions MyLocationStyleOptions?
定位小蓝点
final
onCameraMove → ArgumentCallback<CameraPosition>?
相机视角持续移动的回调
final
onCameraMoveEnd → ArgumentCallback<CameraPosition>?
相机视角移动结束的回调
final
onLocationChanged → ArgumentCallback<AMapLocation>?
位置回调
final
onLongPress → ArgumentCallback<LatLng>?
地图长按事件的回调
final
onMapCreated MapCreatedCallback?
地图创建成功的回调, 收到此回调之后才可以操作地图
final
onPoiTouched → ArgumentCallback<AMapPoi>?
地图POI的点击回调,需要touchPoiEnabledtrue,才能回调
final
onTap → ArgumentCallback<LatLng>?
地图单击事件的回调
final
polygons Set<Polygon>
地图上显示的polygon
final
polylines Set<Polyline>
地图上显示的polyline
final
rotateGesturesEnabled bool
是否支持旋转手势
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleEnabled bool
是否显示比例尺
final
scrollGesturesEnabled bool
是否支持滑动手势
final
tiltGesturesEnabled bool
是否支持倾斜手势
final
touchPoiEnabled bool
地图poi是否允许点击
final
trafficEnabled bool
显示路况开关
final
zoomGesturesEnabled bool
是否支持缩放手势
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
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