InfoWindowExtension class

amap_map插件支持默认的InfoWindow展示titlesnippet字段,如果要自定义 InfoWindow,需要集成此内置插件。

AMapWidget map = AMapWidget(
  onMapCreated: _onMapCreated,
  markers: Set<Marker>.of(_markers.values),
  extensions: [
    InfoWindowExtension(
      infoWindow: Container(
        child: Text('Custom widget'),
    ))
  ],
)

此插件会在AMapWidget外侧套一层Stack,根据屏幕坐标和经纬度进行适配自定义视图

  Stack(
      children: [
        child,
        Positioned(
          top: 0,
          left: 0,
          child: Visibility(child: infoWindow),
        ),
      ],
    )
Inheritance

Constructors

InfoWindowExtension({required Widget infoWindow, InfoWindowOption? option})

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
no setterinherited
infoWindow Widget
final
mapController AMapController?
getter/setter pair
option InfoWindowOption?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bindMapController(AMapController controller) → dynamic
注入AMapController 方便地图交互
override
bindMethodChannel(MethodChannel channel) → dynamic
inherited
build(AMapContext aMapContext, Widget child) Widget
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCameraMove(CameraPosition value) → dynamic
since v1.0.4
override
onCameraMoveEnd(CameraPosition cameraPosition) → dynamic
since v1.0.4
inherited
onDispose() → void
override
onLongPress(LatLng latLng) → dynamic
since v1.0.4
inherited
onMarkerDragEnd(String value) → dynamic
since v1.0.4
inherited
onMarkerTap(String value) → dynamic
since v1.0.4
inherited
onPoiTouched(AMapPoi poi) → dynamic
since v1.0.4
inherited
onPolylineTap(String value) → dynamic
since v1.0.4
inherited
prepare(AMapContext aMapContext) → void
视图层级变化 since v1.0.4
inherited
toString() String
A string representation of this object.
inherited
update(AMapContext aMapContext) → void
视图变化 since v1.0.4
override

Operators

operator ==(Object other) bool
The equality operator.
inherited