Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qiuxiang/react-native-amap-geolocation
React Native geolocation module for Android + iOS
https://github.com/qiuxiang/react-native-amap-geolocation
amap geolocation location react-native
Last synced: 4 days ago
JSON representation
React Native geolocation module for Android + iOS
- Host: GitHub
- URL: https://github.com/qiuxiang/react-native-amap-geolocation
- Owner: qiuxiang
- License: mit
- Created: 2018-04-21T05:11:39.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2023-04-21T01:56:41.000Z (almost 2 years ago)
- Last Synced: 2024-04-18T09:29:36.768Z (9 months ago)
- Topics: amap, geolocation, location, react-native
- Language: TypeScript
- Homepage: https://qiuxiang.github.io/react-native-amap-geolocation
- Size: 799 KB
- Stars: 384
- Watchers: 7
- Forks: 96
- Open Issues: 60
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# react-native-amap-geolocation [![][version-badge]][npm] [![][build-badge]][build]
**注意:该项目目前只维护,不加新功能。**
React Native 高德地图定位模块,支持 Android + iOS,提供尽可能完善的原生接口,
同时提供符合 Web 标准的 Geolocation API。## 用法
```javascript
import { PermissionsAndroid } from "react-native";
import { init, Geolocation } from "react-native-amap-geolocation";await PermissionsAndroid.requestMultiple([
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
]);await init({
ios: "9bd6c82e77583020a73ef1af59d0c759",
android: "043b24fe18785f33c491705ffe5b6935",
});Geolocation.getCurrentPosition(({ coords }) => {
console.log(coords);
});
```## 文档
- [使用指南](https://qiuxiang.github.io/react-native-amap-geolocation)
- [接口文档](https://qiuxiang.github.io/react-native-amap-geolocation/api/)[npm]: https://www.npmjs.com/package/react-native-amap-geolocation
[version-badge]: https://badge.fury.io/js/react-native-amap-geolocation.svg
[build-badge]: https://github.com/qiuxiang/react-native-amap-geolocation/actions/workflows/build.yml/badge.svg
[build]: https://github.com/qiuxiang/react-native-amap-geolocation/actions/workflows/build.yml