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
it takes forever for my location to load, and in turn it delays my map. When I was using expo location, I didn't have this problem, but since I switched to geolocation I delays a lot this is my code:
`import { View, useWindowDimensions, ActivityIndicator, Image, PermissionsAndroid, Platform, } from 'react-native'
import React, {useState, useEffect} from 'react'
import MapView, {Marker, PROVIDER_GOOGLE} from 'react-native-maps';
import Geolocation from '@react-native-community/geolocation';
import * as Location from 'expo-location';
import styles from './styles'
import TMediums from '../../../assets/data/TMediums'
Environment
Platforms
Android
Versions
Description
it takes forever for my location to load, and in turn it delays my map. When I was using expo location, I didn't have this problem, but since I switched to geolocation I delays a lot this is my code:
`import { View, useWindowDimensions, ActivityIndicator, Image, PermissionsAndroid, Platform, } from 'react-native'
import React, {useState, useEffect} from 'react'
import MapView, {Marker, PROVIDER_GOOGLE} from 'react-native-maps';
import Geolocation from '@react-native-community/geolocation';
import * as Location from 'expo-location';
import styles from './styles'
import TMediums from '../../../assets/data/TMediums'
const HomeMap = () => {
const {width, height} = useWindowDimensions()
const [location, setLocation] = useState(null);
const [errorMsg, setErrorMsg] = useState(null);
return (
<MapView
style={{width, height: height - 120}}
provider={PROVIDER_GOOGLE}
initialRegion={{
latitude: location.latitude,
longitude: location.longitude,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
showsUserLocation
>
{TMediums.map((TMedium)=>{
return <Marker
key={TMedium.id}
coordinate={{ latitude : TMedium.latitude , longitude : TMedium.longitude }}>
<Image style={{width:50,
height:70,
resizeMode:'contain',
transform:[{
rotate:
${TMedium.heading}.deg
}]
}}
source={getImage(TMedium.type)}/>
})}
)
}
export default HomeMap`
Reproducible Demo
The text was updated successfully, but these errors were encountered: