amap_map 1.0.0+6 copy "amap_map: ^1.0.0+6" to clipboard
amap_map: ^1.0.0+6 copied to clipboard

Amap SDK Flutter plugin for integrating AMapSDK in iOS and Android applications.

amap_map #

基于高德开放平台地图SDK的flutter插件

Usage #

使用Flutter插件,请参考在Flutter里使用Packages, 添加amap_map的引用

flutter pub add amap_map

Prepare #

Demo #

import 'package:amap_map_example/base_page.dart';
import 'package:flutter/material.dart';

import 'package:amap_map/amap_map.dart';
import 'package:x_amap_base/x_amap_base.dart';

class ShowMapPage extends BasePage {
  ShowMapPage(String title, String subTitle) : super(title, subTitle);
  @override
  Widget build(BuildContext context) {
    return _ShowMapPageBody();
  }
}

class _ShowMapPageBody extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _ShowMapPageState();
}

class _ShowMapPageState extends State<_ShowMapPageBody> {
  static final CameraPosition _kInitialPosition = const CameraPosition(
    target: LatLng(39.909187, 116.397451),
    zoom: 10.0,
  );
  @override
  Widget build(BuildContext context) {
    final AMapWidget map = AMapWidget(
      initialCameraPosition: _kInitialPosition,
      onMapCreated: onMapCreated,
    );

    return ConstrainedBox(
      constraints: BoxConstraints.expand(),
      child: Container(
        height: MediaQuery.of(context).size.height,
        width: MediaQuery.of(context).size.width,
        child: map,
      ),
    );
  }

  AMapController _mapController;
  void onMapCreated(AMapController controller) {
    setState(() {
      _mapController = controller;
    });
  }

}

AMap SDK Version (v1.0.0+6) #

平台 版本
Android 9.8.3
iOS 9.7.0

Issues #

  1. [android] app 的 targetSDKVersion >= 30, 地图页返回闪退

在里的AndroidManifest.xml里的application里增加android:allowNativeHeapPointerTagging="false"

    <application android:allowNativeHeapPointerTagging="false">
    ...
    </application>

google官方说明地址:https://source.android.com/devices/tech/debug/tagged-pointers

9
likes
0
pub points
72%
popularity

Publisher

verified publishermhive.cn

Amap SDK Flutter plugin for integrating AMapSDK in iOS and Android applications.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_plugin_android_lifecycle, plugin_platform_interface, stream_transform, x_amap_base

More

Packages that depend on amap_map