update readme doc
This commit is contained in:
parent
d48d3bb113
commit
718d9cff62
|
@ -16,7 +16,9 @@ flutter pub add amap_map
|
||||||
```
|
```
|
||||||
|
|
||||||
## Prepare
|
## Prepare
|
||||||
* 登录[高德开放平台官网](https://lbs.amap.com/)申请ApiKey。Android平台申请配置key请参考[Android获取key](https://lbs.amap.com/api/poi-sdk-android/develop/create-project/get-key/?sug_index=2), iOS平台申请配置请参考[iOS获取key](https://lbs.amap.com/api/poi-sdk-ios/develop/create-project/get-key/?sug_index=1)。
|
* 登录[高德开放平台官网](https://lbs.amap.com/)申请ApiKey。
|
||||||
|
- Android平台申请配置key请参考[Android获取key](https://lbs.amap.com/api/poi-sdk-android/develop/create-project/get-key/?sug_index=2)
|
||||||
|
- iOS平台申请配置请参考[iOS获取key](https://lbs.amap.com/api/poi-sdk-ios/develop/create-project/get-key/?sug_index=1)
|
||||||
|
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
@ -193,6 +195,7 @@ class AMapWidget extends StatefulWidget {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### 地图控制器
|
### 地图控制器
|
||||||
```dart
|
```dart
|
||||||
|
|
||||||
|
|
|
@ -19,43 +19,43 @@ class AMapWidget extends StatefulWidget {
|
||||||
/// 初始化时的地图中心点
|
/// 初始化时的地图中心点
|
||||||
final CameraPosition initialCameraPosition;
|
final CameraPosition initialCameraPosition;
|
||||||
|
|
||||||
///地图类型
|
/// 地图类型
|
||||||
final MapType mapType;
|
final MapType mapType;
|
||||||
|
|
||||||
///自定义地图样式
|
/// 自定义地图样式
|
||||||
final CustomStyleOptions? customStyleOptions;
|
final CustomStyleOptions? customStyleOptions;
|
||||||
|
|
||||||
///定位小蓝点
|
/// 定位小蓝点
|
||||||
final MyLocationStyleOptions? myLocationStyleOptions;
|
final MyLocationStyleOptions? myLocationStyleOptions;
|
||||||
|
|
||||||
///缩放级别范围
|
/// 缩放级别范围
|
||||||
final MinMaxZoomPreference? minMaxZoomPreference;
|
final MinMaxZoomPreference? minMaxZoomPreference;
|
||||||
|
|
||||||
///地图显示范围
|
/// 地图显示范围
|
||||||
final LatLngBounds? limitBounds;
|
final LatLngBounds? limitBounds;
|
||||||
|
|
||||||
///显示路况开关
|
/// 显示路况开关
|
||||||
final bool trafficEnabled;
|
final bool trafficEnabled;
|
||||||
|
|
||||||
/// 地图poi是否允许点击
|
/// 地图poi是否允许点击
|
||||||
final bool touchPoiEnabled;
|
final bool touchPoiEnabled;
|
||||||
|
|
||||||
///是否显示3D建筑物
|
/// 是否显示3D建筑物,默认显示
|
||||||
final bool buildingsEnabled;
|
final bool buildingsEnabled;
|
||||||
|
|
||||||
///是否显示底图文字标注
|
/// 是否显示底图文字标注
|
||||||
final bool labelsEnabled;
|
final bool labelsEnabled;
|
||||||
|
|
||||||
///是否显示指南针
|
/// 是否显示指南针
|
||||||
final bool compassEnabled;
|
final bool compassEnabled;
|
||||||
|
|
||||||
///是否显示比例尺
|
/// 是否显示比例尺
|
||||||
final bool scaleEnabled;
|
final bool scaleEnabled;
|
||||||
|
|
||||||
///是否支持缩放手势
|
/// 是否支持缩放手势
|
||||||
final bool zoomGesturesEnabled;
|
final bool zoomGesturesEnabled;
|
||||||
|
|
||||||
///是否支持滑动手势
|
/// 是否支持滑动手势
|
||||||
final bool scrollGesturesEnabled;
|
final bool scrollGesturesEnabled;
|
||||||
|
|
||||||
///是否支持旋转手势
|
///是否支持旋转手势
|
||||||
|
@ -332,7 +332,7 @@ class _AMapOptions {
|
||||||
///是否显示3D建筑物
|
///是否显示3D建筑物
|
||||||
final bool? buildingsEnabled;
|
final bool? buildingsEnabled;
|
||||||
|
|
||||||
///是否显示底图文字标注
|
/// 是否显示底图文字标注,默认显示
|
||||||
final bool? labelsEnabled;
|
final bool? labelsEnabled;
|
||||||
|
|
||||||
///是否显示指南针
|
///是否显示指南针
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math';
|
|
||||||
|
|
||||||
import 'package:x_amap_base/x_amap_base.dart';
|
import 'package:x_amap_base/x_amap_base.dart';
|
||||||
import 'package:amap_map/src/core/amap_flutter_platform.dart';
|
import 'package:amap_map/src/core/amap_flutter_platform.dart';
|
||||||
|
@ -45,7 +44,7 @@ class MethodChannelAMapFlutterMap implements AMapFlutterPlatform {
|
||||||
return channel.invokeMethod<void>('map#waitForMap');
|
return channel.invokeMethod<void>('map#waitForMap');
|
||||||
}
|
}
|
||||||
|
|
||||||
///更新地图参数
|
/// 更新地图参数
|
||||||
Future<void> updateMapOptions(
|
Future<void> updateMapOptions(
|
||||||
Map<String, dynamic> newOptions, {
|
Map<String, dynamic> newOptions, {
|
||||||
required int mapId,
|
required int mapId,
|
||||||
|
@ -137,32 +136,37 @@ class MethodChannelAMapFlutterMap implements AMapFlutterPlatform {
|
||||||
return _events(mapId).whereType<LocationChangedEvent>();
|
return _events(mapId).whereType<LocationChangedEvent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Camera 移动回调
|
// Camera 移动回调
|
||||||
Stream<CameraPositionMoveEvent> onCameraMove({required int mapId}) {
|
Stream<CameraPositionMoveEvent> onCameraMove({required int mapId}) {
|
||||||
return _events(mapId).whereType<CameraPositionMoveEvent>();
|
return _events(mapId).whereType<CameraPositionMoveEvent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
///Camera 移动结束回调
|
/// Camera 移动结束回调
|
||||||
Stream<CameraPositionMoveEndEvent> onCameraMoveEnd({required int mapId}) {
|
Stream<CameraPositionMoveEndEvent> onCameraMoveEnd({required int mapId}) {
|
||||||
return _events(mapId).whereType<CameraPositionMoveEndEvent>();
|
return _events(mapId).whereType<CameraPositionMoveEndEvent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Camera 地图点击回调
|
||||||
Stream<MapTapEvent> onMapTap({required int mapId}) {
|
Stream<MapTapEvent> onMapTap({required int mapId}) {
|
||||||
return _events(mapId).whereType<MapTapEvent>();
|
return _events(mapId).whereType<MapTapEvent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Camera 地图长按回调
|
||||||
Stream<MapLongPressEvent> onMapLongPress({required int mapId}) {
|
Stream<MapLongPressEvent> onMapLongPress({required int mapId}) {
|
||||||
return _events(mapId).whereType<MapLongPressEvent>();
|
return _events(mapId).whereType<MapLongPressEvent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Camera 地图POI点点击回调
|
||||||
Stream<MapPoiTouchEvent> onPoiTouched({required int mapId}) {
|
Stream<MapPoiTouchEvent> onPoiTouched({required int mapId}) {
|
||||||
return _events(mapId).whereType<MapPoiTouchEvent>();
|
return _events(mapId).whereType<MapPoiTouchEvent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Camera 地图锚点点击回调
|
||||||
Stream<MarkerTapEvent> onMarkerTap({required int mapId}) {
|
Stream<MarkerTapEvent> onMarkerTap({required int mapId}) {
|
||||||
return _events(mapId).whereType<MarkerTapEvent>();
|
return _events(mapId).whereType<MarkerTapEvent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Camera 地图锚点拖拽结束回调
|
||||||
Stream<MarkerDragEndEvent> onMarkerDragEnd({required int mapId}) {
|
Stream<MarkerDragEndEvent> onMarkerDragEnd({required int mapId}) {
|
||||||
return _events(mapId).whereType<MarkerDragEndEvent>();
|
return _events(mapId).whereType<MarkerDragEndEvent>();
|
||||||
}
|
}
|
||||||
|
@ -234,7 +238,7 @@ class MethodChannelAMapFlutterMap implements AMapFlutterPlatform {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///移动镜头到一个新的位置
|
/// 移动镜头到一个新的位置
|
||||||
Future<void> moveCamera(
|
Future<void> moveCamera(
|
||||||
CameraUpdate cameraUpdate, {
|
CameraUpdate cameraUpdate, {
|
||||||
required int mapId,
|
required int mapId,
|
||||||
|
|
Loading…
Reference in New Issue