const
AMapView(- {Key? key,
- AMapViewController? controller,
- bool autoLocateAfterInit = false,
- MapType mapType = MapType.NORMAL,
- MapLanguage mapLanguage = MapLanguage.CHINESE,
- LocationType locationType = LocationType.LOCATE,
- int locationInterval = 2000,
- bool showTraffic = false,
- bool showBuildings = true,
- bool showMapText = true,
- bool showZoomControl = true,
- bool showCompass = false,
- bool showLocationButton = false,
- bool showScaleControl = false,
- bool showIndoorMap = false,
- bool showIndoorMapControl = false,
- bool? allGestureEnable,
- bool zoomGestureEnable = true,
- bool rotateGestureEnable = true,
- bool scrollGestureEnable = true,
- bool tiltGestureEnable = true,
- bool isGestureScaleByMapCenter = false,
- ZoomPosition zoomPosition = ZoomPosition.RIGHT_BOTTOM,
- LogoPosition logoPosition = LogoPosition.BOTTOM_LEFT,
- LogoMargin? logoMargin,
- CompassMargin? compassMargin,
- ScaleMargin? scaleMargin,
- double initialZoomLevel = 12.0,
- double maxZoomLevel = 20.0,
- double minZoomLevel = 3.0,
- String? customMapStyleId,
- CameraPosition? defaultCameraPosition,
- List<LatLng>? androidBound,
- IosBound? iOSBound}
)
Implementation
const AMapView({
Key? key,
this.controller,
this.autoLocateAfterInit = false,
this.mapType = MapType.NORMAL,
this.mapLanguage = MapLanguage.CHINESE,
this.locationType = LocationType.LOCATE,
this.locationInterval = 2000,
this.showTraffic = false,
this.showBuildings = true,
this.showMapText = true,
this.showZoomControl = true,
this.showCompass = false,
this.showLocationButton = false,
this.showScaleControl = false,
this.showIndoorMap = false,
this.showIndoorMapControl = false,
this.allGestureEnable,
this.zoomGestureEnable = true,
this.rotateGestureEnable = true,
this.scrollGestureEnable = true,
this.tiltGestureEnable = true,
this.isGestureScaleByMapCenter = false,
this.zoomPosition = ZoomPosition.RIGHT_BOTTOM,
this.logoPosition = LogoPosition.BOTTOM_LEFT,
this.logoMargin,
this.compassMargin,
this.scaleMargin,
this.initialZoomLevel = 12.0,
this.maxZoomLevel = 20.0,
this.minZoomLevel = 3.0,
this.customMapStyleId,
this.defaultCameraPosition,
this.androidBound,
this.iOSBound,
}) : assert(
initialZoomLevel >= minZoomLevel &&
initialZoomLevel <= maxZoomLevel,
'初始化缩放等级不能小于最小缩放等级,并且不能大于最大缩放等级'),
assert(maxZoomLevel <= 20, '最大缩放等级不能大于20'),
assert(minZoomLevel >= 3, '最小缩放等级不能小于3'),
super(key: key);