mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-11 22:32:38 +08:00
[ReactNative] geolocation method docs
This commit is contained in:
@@ -50,7 +50,8 @@ var GeolocationExample = React.createClass({
|
||||
componentDidMount: function() {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(initialPosition) => this.setState({initialPosition}),
|
||||
(error) => console.error(error)
|
||||
(error) => console.error(error),
|
||||
{enableHighAccuracy: true, timeout: 100, maximumAge: 1000}
|
||||
);
|
||||
this.watchID = navigator.geolocation.watchPosition((lastPosition) => {
|
||||
this.setState({lastPosition});
|
||||
|
||||
Reference in New Issue
Block a user