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-geo
and addRNReverseGeo.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNReverseGeo.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Click
RNReverseGeo.xcodeproj
in the project navigator and go theBuild Settings
tab. Make sure 'All' is toggled on (instead of 'Basic'). Look forHeader Search Paths
and make sure it contains both$(SRCROOT)/../react-native/React
and$(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.