A geocoding module for React Native to transform a description of a location (i.e. street address, town name, etc.) into geographic coordinates (i.e. latitude and longitude).
This module uses Google Maps Geocoding API and requires an API key for purposes of quota management. Please check this link out to obtain your API key.
npm install --save react-native-geocoding
import Geocoder from 'react-native-geocoding';
Geocoder.setApiKey('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); // use a valid API key
Geocoder.getFromLocation("Colosseum").then(
json => {
var location = json.results[0].geometry.location;
alert(location.lat + ", " + location.lng);
},
error => {
alert(error);
}
);
See CHANGELOG.md