You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<MapView
style={{width, height:height - 150}}
provider={PROVIDER_GOOGLE}
showsUserLocation
followsUserLocation
initialRegion={{
latitude: myPosition.latitude,
longitude: myPosition.longitude,
latitudeDelta: 0.0222,
longitudeDelta: 0.0121,
}}
>`
The error message, I get is that it is unable to read myPosition.latitude.
Like I said, this line of code worked previously for my other project, but it's not working here. Hope to get a quick response from you. Thank you
The text was updated successfully, but these errors were encountered:
I used this same line of code in one of my project and it worked, but for some reason, i am unable to get current location in my currenet project.
`import { View, Image, useWindowDimensions, PermissionsAndroid, Platform, } from 'react-native'
import React, {useState,useEffect} from 'react'
import MapView, { PROVIDER_GOOGLE, Marker } from 'react-native-maps';
import Geolocation from '@react-native-community/geolocation';
import TMediums from '../../assets/data/TMediums';
navigator.geolocation = require('@react-native-community/geolocation');
const HomeMap = () => {
const {width, height} = useWindowDimensions()
const [myPosition, setMyPosition] = useState(null)
<MapView
style={{width, height:height - 150}}
provider={PROVIDER_GOOGLE}
showsUserLocation
followsUserLocation
initialRegion={{
latitude: myPosition.latitude,
longitude: myPosition.longitude,
latitudeDelta: 0.0222,
longitudeDelta: 0.0121,
}}
>`
The error message, I get is that it is unable to read myPosition.latitude.
Like I said, this line of code worked previously for my other project, but it's not working here. Hope to get a quick response from you. Thank you
The text was updated successfully, but these errors were encountered: