IMapController class abstract

地图控制类

Constructors

IMapController()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addCircle(CircleOption option) Future<ICircle>
添加圆
addDistrictOutline(String districtName, {double width = 5, Color strokeColor = Colors.green, Color fillColor = Colors.transparent, bool onlyMainDistrict = true, double sampleRate = 1.0}) Future<List<IPolygon>>
添加地区轮廓
addDriveRoute({required LatLng from, required LatLng to, List<LatLng>? passbyPointList, TrafficOption? trafficOption, double lineWidth = 10, ImageProvider<Object>? customTexture}) Future<void>
根据起点from和终点to坐标, 搜索出路径并将驾车路线规划结果driveRouteResult添加到地图上, 可以配置交通拥堵情况trafficOption, 路线的宽度lineWidth, 自定纹理customTexture.
addGroundOverlay(GroundOverlayOption option) Future<IGroundOverlay>
添加图片覆盖物
addHeatmapTileOverlay(HeatmapTileOption option) Future<IHeatmapOverlay>
添加热力图
addMarker(MarkerOption option) Future<IMarker>
添加marker
addMarkers(List<MarkerOption> options) Future<List<IMarker>>
批量添加marker
addMultiPointOverlay(MultiPointOption option) Future<IMultiPointOverlay>
添加海量点
addPlaybackTrace(List<LatLng> coordinateList, {double width = 5, Color strokeColor = Colors.green, required ImageProvider<Object> iconProvider, required Duration duration}) Future<IPlaybackTrace>
添加回放轨迹
addPolygon(PolygonOption option) Future<IPolygon>
添加多边形
addPolyline(PolylineOption option) Future<IPolyline>
添加折线
addSmoothMoveMarker(SmoothMoveMarkerOption option) Future<ISmoothMoveMarker>
添加平滑移动marker
addUrlTileOverlay(UrlTileOption option) Future<IUrlTileOverlay>
Add tile overlay.
clear({bool keepMyLocation = true}) Future<void>
清除地图上所有覆盖物
clearMarkers(List<IMarker> markers) Future<void>
把marker列表从地图上移除
dispose() Future<void>
Dispose map controller.
fromScreenLocation(Point<num> point) Future<LatLng?>
屏幕坐标转经纬度坐标
getCenterCoordinate() Future<LatLng?>
获取地图中心点
getLocation() Future<LatLng?>
Get current location.
getZoomLevel() Future<double?>
获取当前缩放大小
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
screenShot() Future<Uint8List?>
截图
setAllGesturesEnabled(bool enable) Future<void>
所有手势使能
setBearing(double bearing, {bool animated = true}) Future<void>
设置地图朝向
setCameraPosition({required LatLng coordinate, double? zoom, double? tilt, double? bearing, bool animated = true, Duration duration = const Duration(milliseconds: 500)}) Future<void>
一次性设置地图视角
setCenterCoordinate(LatLng coordinate, {double? zoomLevel, double? bearing, double? tilt, bool animated = true}) Future<void>
设置地图中心点
setCustomMapStyle({String styleDataPath, String styleExtraPath, String texturePath}) Future<void>
自定义地图
setFps(int fps) Future<void>
设置的地图刷新帧率
setInfoWindowClickListener(OnMarkerClicked onInfoWindowClicked) Future<void>
Marker弹窗点击事件监听
setMapAnchor(double anchorU, double anchorV) Future<void>
设置地图锚点
setMapClickedListener(OnMapClicked onMapClick) Future<void>
设置地图点击监听事件
setMapLongPressedListener(OnMapClicked onMapLongPress) Future<void>
设置地图长按监听事件
setMapMoveListener({OnMapMove? onMapMoveStart, OnMapMove? onMapMoving, OnMapMove? onMapMoveEnd}) Future<void>
设置地图移动监听事件
setMapRegionLimits(LatLng southWest, LatLng northEast) Future<void>
限制地图的显示范围
setMapType(MapType mapType) Future<void>
选择显示图层
setMarkerClickedListener(OnMarkerClicked onMarkerClicked) Future<void>
设置marker点击监听事件
setMarkerDragListener({OnMarkerDrag? onMarkerDragStart, OnMarkerDrag? onMarkerDragging, OnMarkerDrag? onMarkerDragEnd}) Future<void>
设置marker拖动监听事件
setMaxZoomLevel(double zoomLevel) Future<void>
设置最大缩放等级
setMinZoomLevel(double zoomLevel) Future<void>
设置最小缩放等级
setMyLocationRotateAngle(double angle) Future<void>
设置我的位置图标旋转角度
setPadding(EdgeInsets padding) Future<void>
给地图添加padding
setRotateGesturesEnabled(bool enable) Future<void>
旋转手势使能
setScrollGesturesEnabled(bool enable) Future<void>
滑动手势使能
setTilt(double tilt, {bool animated = true}) Future<void>
设置地图倾斜度
setTiltGesturesEnabled(bool enable) Future<void>
旋转手势使能
setZoomByCenter(bool byCenter) Future<void>
设置缩放是否以中心点为锚点
setZoomGesturesEnabled(bool enable) Future<void>
缩放手势使能
setZoomLevel(double level, {bool animated = true}) Future<void>
设置缩放大小
showBuildings(bool show) Future<void>
显示/隐藏3D楼块效果
showCompass(bool enable) Future<void>
显示指南针
showIndoorMap(bool show) Future<void>
是否显示室内地图
showLocateControl(bool enable) Future<void>
显示定位按钮
showMapText(bool show) Future<void>
显示/隐藏地图上的文字标注
showMyLocation(MyLocationOption option) Future<void>
Show my location with option.
showScaleControl(bool enable) Future<void>
显示比例尺控件
showTraffic(bool enable) Future<void>
显示路况信息
showZoomControl(bool enable) Future<void>
显示缩放控件
toScreenLocation(LatLng coordinate) Future<Point<num>?>
经纬度坐标转屏幕坐标
toString() String
A string representation of this object.
inherited
zoomIn({bool animated = true}) Future<void>
放大一个等级
zoomOut({bool animated = true}) Future<void>
放大一个等级
zoomToSpan(List<LatLng> bounds, {EdgeInsets padding = const EdgeInsets.all(50), bool animated = true}) Future<void>
将指定的经纬度列表(包括但不限于marker, polyline, polygon等)调整至同一屏幕中显示

Operators

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