Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shashank2406/react-native-google-location-fetcher

Google Location Fetcher
https://github.com/shashank2406/react-native-google-location-fetcher

google-api location react-native

Last synced: about 1 month ago
JSON representation

Google Location Fetcher

Awesome Lists containing this project

README

        

# react-native-google-location-fetcher
Google Location Fetcher for iOS and Android React-Native apps

## PLANNED FEATURES

- [x] Get Location Coordinates
- [x] Reverse Geocoding from Google API
- [x] Get Location Name from Google API
- [x] Get any Location Coordinates from Google API
- [ ] Ask permission for location on Android

### Installation

1. ```npm install react-native-google-location-fetcher --save```
2. Get your [Google Places API keys](https://developers.google.com/places/) and enable "Google Places API Web Service" (NOT Android or iOS) in the console.
3. Enable "Google Maps Geocoding API" if you want to use GoogleReverseGeocoding for Current Location

For Android: add the following line in your AndroidManifest.xml
```xml

```

### Example

```jsx
import React from 'react';
import { View, Image } from 'react-native';
import {GoogleLocationFetcher} from 'react-native-google-location-fetcher'

export default class App extends Component {
componentWillMount(){
// To initialise the module
GoogleLocationFetcher.initialise(YOUR_API_KEY)
// To get current Location coordinates and name
console.log(GoogleLocationFetcher.getCurrentLocation())
// To get location name from coordinates
console.log(GoogleLocationFetcher.getLocationName(LATITUDE,LONGITUDE))
// TO get location coordinates
console.log(GoogleLocationFetcher.getLocationCoordinates(ANY_LOCATION_NAME))
}
render() {
return (

Welcome to React Native!
To get started, edit App.js
{instructions}

);
}
}

```