question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: Failed prop type: Invalid prop `destination` supplied to `MapViewDirections`

See original GitHub issue
<MapView
  region={{
	latitude: this.state.location.latitude,
	longitude: this.state.location.longitude,
	latitudeDelta: LATITUDE_DELTA,
	longitudeDelta: LONGITUDE_DELTA,
  }}
  onRegionChange={this.onRegionChange}
  initialRegion={{
	latitude: this.state.location.latitude,
	longitude: this.state.location.longitude,
	latitudeDelta: LATITUDE_DELTA,
	longitudeDelta: LONGITUDE_DELTA,
  }}
  onMapReady={Platform.OS === 'android' ? this.onMapLayout : null}
  onLayout={Platform.OS === 'ios' ? this.onMapLayout : null}
  mapType='standard'
  showsCompass
  showsBuildings>
  { this.state.isMapReady &&
	<MapViewDirections
	  origin={this.state.location}
	  destination={this.state.destination}
	  apikey={this.state.maps_apikey}
	  strokeWidth={3}
	  strokeColor="blue"
	/>
  }

</MapView>

this returns: Warning: Failed prop type: invalid prop destination supplied to MapViewDirections.

This is a bug? Any solution?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

5reactions
jpdesignerriocommented, Aug 20, 2018

I found the problem! Just parse the

response.address.latitude

and

response.address.longitude

to float, it’s string! (Using parseFloat function)

0reactions
moustaouiSalaheddinecommented, Nov 29, 2022

cast value every change { latitude: parseFloat(latitude), longitude: parseFloat(longitude) }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid prop `region.latitude` of type `string` supplied to ...
js file and assign it to longitude and latitude values. but I'm getting an error saying... Warning: Failed prop type: Invalid prop region....
Read more >
react-native-maps-directions - npm
The mandatory MapViewDirections props are: origin : The coordinate of the origin location; destination : The coordinate of the destination ...
Read more >
How to use MapViewDirections in react-native-maps-directions
const Directions = ({ destination, origin, onReady }) => (
Read more >
Warning failed prop type the prop 'x' is marked as required ...
Coding example for the question Warning failed prop type the prop 'x' is marked as required when updating mapView-React Native.
Read more >
react-native-maps-directions - npm package - Snyk
The mandatory MapViewDirections props are: ... Once the directions in between destination and origin has been fetched, ... Prop, Type, Default, Note ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found