Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the Geolocation import in MapViewNavigation/index.js file for… #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/MapViewNavigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);

Expand All @@ -140,7 +141,7 @@ export default class MapViewNavigation extends Component {
*/
componentWillUnmount()
{
navigator.geolocation.clearWatch(this.watchId);
Geolocation.clearWatch(this.watchId);
}

/**
Expand Down