美文网首页
接入amap_map_fluttify 0.25.0 高德地图社

接入amap_map_fluttify 0.25.0 高德地图社

作者: Yelena_CYL | 来源:发表于2020-08-19 11:04 被阅读0次

    amap_map_fluttify 0.25.0高德地图 地图组件 Flutter插件

    第三方库

    amap_map_fluttify: ^0.25.0

    amap_core_fluttify: ^0.9.5

    amap_location_fluttify: ^0.14.0+1

    permission_handler: ^5.0.0+hotfix.8

    fluttertoast: ^4.0.1

    url_launcher: ^5.5.0

    配置 #

    Android #

    1.注意在app/build.gradle的android块中配置签名信息, 并在buildTypes块中指定签名信息, 否则将无法匹配到你在高德后台配置的appkey, 例如:

    android {

        signingConfigs {

            release {

                keyAlias 'amap_map_test'

                keyPassword 'amap_map_test'

                storeFile file('可以用keystore路径替代')

                storePassword 'amap_map_test'

            }

        }

        buildTypes {

            debug {

                signingConfig signingConfigs.release

            }

            profile {

                signingConfig signingConfigs.release

            }

            release {

                signingConfig signingConfigs.release

            }

        }

    }

    iOS #

    1.使用地图需要使能UiKitView, 在Info.plist中添加:

    <key>io.flutter.embedded_views_preview</key>

    <string>YES</string>

    1.定位需要声明权限, 在Info.plist中添加:

    <key>NSLocationWhenInUseUsageDescription</key>

    <string>需要定位权限</string>

    1.调用高德地图需要添加白名单:

    <key>LSApplicationQueriesSchemes</key>

    <array>

    <string>iosamap</string>

    <string>amapuri</string>

    </array>

    [✓] Flutter (Channel stable, 1.20.0, on Mac OS X 10.15.1 19B88, locale

        zh-Hans-CN)

    [✓] Android toolchain - develop for Android devices (Android SDK version

        30.0.0-rc1)

    [✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)

    [✓] Android Studio (version 4.0)

    [✓] VS Code (version 1.47.3)

    SHA1获取

    Release:

    终端引入:项目对应keystore文件路径,去掉keystore。回车

    keytool -list -v -keystore keystore

    输入keystore密码,即可获取。

    Debug:

    终端引入:项目对应keystore文件路径,去掉keystore。回车

    keytool -list -v -keystore debug.keystore

    输入keystore密码,即可获取。

    NetworkSecurityConfig问题,http未被激活,导致安卓demo位置信息解析不出来。必须调用AmapView()后才会激活

    具体demo查看

    https://gitee.com/yelenaLei/yelena_amap

    实现高德地图demo目前主要有以下功能(社区版)

    1.获取当前位置信息

    2.指定经纬度打标签(marker)

    3.根据多个经纬度可以绘制多边形

    4.根据中心点绘制范围圆,

    5.地图实现:定位,跟踪定位,指南针、比例尺显示与否的展示,地图范围放大缩小

    6.地图截屏

    7.高德地图app导航跳转

    pad没有陀螺仪所以定位方向跟随的时候箭头不会旋转

    高德地图mapview不显示:

    AndroidManifest.xml文件中增加

    android:name="com.xwtec.commmanager.activity.comm.CustMapActivity"

    android:hardwareAccelerated="false" >

    设置android:hardwareAccelerated="true"就可以。

    相关文章

      网友评论

          本文标题:接入amap_map_fluttify 0.25.0 高德地图社

          本文链接:https://www.haomeiwen.com/subject/zbsrjktx.html