diff --git a/src/components/MapViewNavigation/index.js b/src/components/MapViewNavigation/index.js index 092a213a..ef3c3ebd 100644 --- a/src/components/MapViewNavigation/index.js +++ b/src/components/MapViewNavigation/index.js @@ -4,7 +4,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import {CoordinatePropType} from '../../constants/PropTypes'; -import { View, TouchableOpacity, Text, Dimensions, Geolocation } from 'react-native'; +import Geolocation from '@react-native-community/geolocation'; +import { View, TouchableOpacity, Text, Dimensions } from 'react-native'; import connectTheme from '../../themes'; import Geocoder from '../../modules/Geocoder'; import Directions from '../../modules/Directions'; @@ -128,7 +129,7 @@ export default class MapViewNavigation extends Component { */ componentDidMount() { - this.watchId = navigator.geolocation.watchPosition(position => { + this.watchId = Geolocation.watchPosition(position => { this.setPosition(position.coords); @@ -140,7 +141,7 @@ export default class MapViewNavigation extends Component { */ componentWillUnmount() { - navigator.geolocation.clearWatch(this.watchId); + Geolocation.clearWatch(this.watchId); } /**