React Native module bridge to convert address to geo coordinates.
Makes use of the following native iOS classes:
- From inside your project run
npm install react-native-reverse-geo --save - In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-reverse-geoand addRNReverseGeo.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNReverseGeo.ato your project'sBuild Phases➜Link Binary With Libraries - Click
RNReverseGeo.xcodeprojin the project navigator and go theBuild Settingstab. Make sure 'All' is toggled on (instead of 'Basic'). Look forHeader Search Pathsand make sure it contains both$(SRCROOT)/../react-native/Reactand$(SRCROOT)/../../React- mark both asrecursive. - RNReverseGeoRun your project (
Cmd+R)
var React = require('react-native');
// Load Up our Native Module..
var {
RNReverseGeo
} = require('NativeModules');
getInitialState: function() {
return {
reverseGeoResults: "Loading..."
};
},
componentDidMount: function() {
var that = this;
RNReverseGeo.geoCodeAddress("370 Tompkins Ave, Brooklyn, NY 11216",
function(_results){
console.log(_results);
that.setState({
reverseGeoResults : JSON.stringify(_results,null,2)
})
});
},There is an example project supplied with the repo in the RNReverseGeoDemo folder.