diff --git a/src/components/MapViewNavigation/index.js b/src/components/MapViewNavigation/index.js index 092a213a..c9e1fa9e 100644 --- a/src/components/MapViewNavigation/index.js +++ b/src/components/MapViewNavigation/index.js @@ -128,13 +128,20 @@ export default class MapViewNavigation extends Component { */ componentDidMount() { - this.watchId = navigator.geolocation.watchPosition(position => { - - this.setPosition(position.coords); - - }); + if (!this.props.simulate) { + this.watchId = geolocation.watchPosition(position => { + this.setPosition(position.coords); + }, + (err) => {console.error(err)}, + { enableHighAccuracy: true, timeout: 10, maximumAge: 0, distanceFilter: 0 }); + + } else { + this.watchId = navigator.geolocation.watchPosition(position => { + this.setPosition(position.coords); + }); + } } - + /** * @componentWillUnmount */