bramus / react-native-maps-directions

Directions Component for `react-native-maps`
MIT License
1.25k stars 197 forks source link

React Native Map Direction avoid Highways & tolls #135

Open oxientsoft opened 4 years ago

oxientsoft commented 4 years ago

if any solution how to void Highway & tolls using react-native-maps-directions

this my code

<MapViewDirections origin={this.state.Origin} destination={this.state.mapRegion} //mapRegion from geolocation apikey={GOOGLE_MAPS_APIKEY} strokeWidth={6} precision="high" mode="TRANSIT" strokeColor="#12bc00" onStart={(params) => { console.log(Started routing between "${params.origin}" and "${params.destination}"`);

      }}
      onReady={result => {
        console.log(`Distance: ${result.distance} km`)
        console.log(`Duration: ${result.duration} min.`)
        this.setState({
      Dinstance: result.distance.toFixed(2),
      Duration: result.duration.toFixed(2)

  })

      }}

/>`

victormaneac commented 4 weeks ago

+1 I am also interested in a solution for this use case - more precisely, when the user is redirected to the Google Maps application, I want the "Avoid Highways" to already be selected