Skip to content

QiFuFE/react-native-amap-geolocation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-amap-geolocation npm version build status

React Native 高德地图定位模块,支持 Android + iOS。

使用

  1. 安装
  2. 获取 Key:
import { Geolocation } from "react-native-amap-geolocation"

await Geolocation.init({
  ios: "9bd6c82e77583020a73ef1af59d0c759",
  android: "043b24fe18785f33c491705ffe5b6935"
})

Geolocation.setOptions({
  interval: 8000,
  distanceFilter: 20
})

Geolocation.addLocationListener(location => console.log(location))
Geolocation.start()

文档

示例

你可以直接下载安装 example.apk,或者按照以下步骤运行项目示例:

yarn

# android
yarn run-android

# ios
cd ios && pod install && cd ..
yarn run-ios

About

React Native geolocation module for Android + iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 39.4%
  • Objective-C 33.6%
  • JavaScript 16.8%
  • Ruby 10.2%