react-native-amap-geolocation高德地图

晏树
2023-12-01

title: react-native-amap-geolocation
tags:

  • react-native-amap-geolocation
  • 高德地图
  • 地图
  • map

react-native-amap-geolocation

NPM参考官方参考

文档

简介

  • 使用高德地图api在程序中获取定位

安装

npm i react-native-amap-geolocation

settings.gradle

include ':react-native-amap-geolocation'
project(':react-native-amap-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-amap-geolocation/lib/android')

~\android\app\build.gradle

dependencies {
    implementation project(':react-native-amap-geolocation') // 定位
    }

~\android\app\src\main\java\com\tanhuajiaoyou\MainApplication.java

import cn.qiuxiang.react.geolocation.AMapGeolocationPackage;

protected List<ReactPackage> getPackages() {
    @SuppressWarnings("UnnecessaryLocalVariable")
  ····················
    packages.add(new AMapGeolocationPackage());
    return packages;
}

参考

https://blog.csdn.net/u011149565/article/details/90216803
https://www.jianshu.com/p/dcfca6041154

 类似资料: