update readme doc

This commit is contained in:
Kuloud 2024-01-03 18:31:54 +08:00
parent d48d3bb113
commit 718d9cff62
3 changed files with 26 additions and 19 deletions

View File

@ -16,7 +16,9 @@ flutter pub add amap_map
```
## 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
@ -193,6 +195,7 @@ class AMapWidget extends StatefulWidget {
}
```
### 地图控制器
```dart

View File

@ -19,43 +19,43 @@ class AMapWidget extends StatefulWidget {
///
final CameraPosition initialCameraPosition;
///
///
final MapType mapType;
///
///
final CustomStyleOptions? customStyleOptions;
///
///
final MyLocationStyleOptions? myLocationStyleOptions;
///
///
final MinMaxZoomPreference? minMaxZoomPreference;
///
///
final LatLngBounds? limitBounds;
///
///
final bool trafficEnabled;
/// poi是否允许点击
final bool touchPoiEnabled;
///3D建筑物
/// 3D建筑物
final bool buildingsEnabled;
///
///
final bool labelsEnabled;
///
///
final bool compassEnabled;
///
///
final bool scaleEnabled;
///
///
final bool zoomGesturesEnabled;
///
///
final bool scrollGesturesEnabled;
///
@ -332,7 +332,7 @@ class _AMapOptions {
///3D建筑物
final bool? buildingsEnabled;
///
///
final bool? labelsEnabled;
///

View File

@ -11,7 +11,6 @@
// distributed under the License is distributed on an "AS IS" BASIS,
import 'dart:async';
import 'dart:math';
import 'package:x_amap_base/x_amap_base.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');
}
///
///
Future<void> updateMapOptions(
Map<String, dynamic> newOptions, {
required int mapId,
@ -137,32 +136,37 @@ class MethodChannelAMapFlutterMap implements AMapFlutterPlatform {
return _events(mapId).whereType<LocationChangedEvent>();
}
//Camera
// Camera
Stream<CameraPositionMoveEvent> onCameraMove({required int mapId}) {
return _events(mapId).whereType<CameraPositionMoveEvent>();
}
///Camera
/// Camera
Stream<CameraPositionMoveEndEvent> onCameraMoveEnd({required int mapId}) {
return _events(mapId).whereType<CameraPositionMoveEndEvent>();
}
/// Camera
Stream<MapTapEvent> onMapTap({required int mapId}) {
return _events(mapId).whereType<MapTapEvent>();
}
/// Camera
Stream<MapLongPressEvent> onMapLongPress({required int mapId}) {
return _events(mapId).whereType<MapLongPressEvent>();
}
/// Camera POI点点击回调
Stream<MapPoiTouchEvent> onPoiTouched({required int mapId}) {
return _events(mapId).whereType<MapPoiTouchEvent>();
}
/// Camera
Stream<MarkerTapEvent> onMarkerTap({required int mapId}) {
return _events(mapId).whereType<MarkerTapEvent>();
}
/// Camera
Stream<MarkerDragEndEvent> onMarkerDragEnd({required int mapId}) {
return _events(mapId).whereType<MarkerDragEndEvent>();
}
@ -234,7 +238,7 @@ class MethodChannelAMapFlutterMap implements AMapFlutterPlatform {
}
}
///
///
Future<void> moveCamera(
CameraUpdate cameraUpdate, {
required int mapId,