I have been searching the web for proper documentation in regards to this error, am in in no luck as i am unable to determine the cause of this error.
Here is the m
I was receiving the lat, lng value as props so what worked for me was:
<Marker
coordinate={{
longitude: longitude ? longitude : 0,
latitude: latitude ? latitude : 0
}}
title={'owner location'}
/>
Changing the initial value in coordinates from null
to []
solved the issue.
<MapView.Polyline
strokeWidth={2}
strokeColor="#00ff00"
coordinates={coords}
/>
Set initial state values to 0 instead of null.
this.state = {
latitude:0,
longitude: 0,
latitudeDelta: 0.09,
longitudeDelta: 0.02,
};
passing this helped me solve this:
coordinate={{
latitude: props && props.position && Number(props.position.latitude) ? Number(props.position.latitude) : 0,
longitude: props && props.position && Number(props.position.longitude) ? Number(props.position.longitude) : 0
}}
The fix is this: while you are updating the <Marker/>
component, make sure that you are not passing null in the coordinates' latitude or longitude.
I faced the same error while looping through an object, where some of my fields were empty. I solved it by defaulting to 0 whenever there was an empty value.