bramus / react-native-maps-directions

Directions Component for `react-native-maps`
MIT License
1.24k stars 196 forks source link

Additional error on `Error on GMAPS route request, ZERO_RESULTS` #134

Open karimcambridge opened 4 years ago

karimcambridge commented 4 years ago
react-native-maps-directions Error on GMAPS route request, ZERO_RESULTS
- node_modules\react-native\Libraries\YellowBox\YellowBox.js:71:8 in console.warn
- node_modules\expo\build\environment\muteWarnings.fx.js:18:23 in warn
- node_modules\react-native-maps-directions\src\MapViewDirections.js:266:10 in fetch.then.then._catch$argument_0
- node_modules\promise\setimmediate\core.js:37:14 in tryCallOne
- node_modules\promise\setimmediate\core.js:123:25 in setImmediate$argument_0
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:146:14 in _callTimer
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:194:17 in _callImmediatesPass
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:458:30 in callImmediates
* [native code]:null in callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:407:6 in __callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:143:6 in __guard$argument_0
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:384:10 in __guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:142:17 in __guard$argument_0
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

[Unhandled promise rejection: TypeError: undefined is not an object (evaluating '_ref.distance')]
- node_modules\react-native-maps-directions\src\MapViewDirections.js:184:26 in Promise.all.then$argument_0
* [native code]:null in reduce
- node_modules\react-native-maps-directions\src\MapViewDirections.js:182:22 in Promise.all.then$argument_0
- node_modules\promise\setimmediate\core.js:37:14 in tryCallOne
- node_modules\promise\setimmediate\core.js:123:25 in setImmediate$argument_0
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:146:14 in _callTimer
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:194:17 in _callImmediatesPass
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:458:30 in callImmediates
* [native code]:null in callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:407:6 in __callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:143:6 in __guard$argument_0
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:384:10 in __guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:142:17 in __guard$argument_0
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

This error is happening when you try to use a directions from one island to another

<MapViewDirection
            destination={destination}
            origin={origin}
            onReady={onReady}
            onError={onError}
            apikey={GOOGLE_API_KEY_PLACES}
            strokeWidth={3}
            optimizeWaypoints={true} // Billing?
            timePrecision={'now'}
            waypoints={[]}
        />

The onError isn't called else I would just handle the error there.

sooraj-panchal commented 4 years ago

how to solvev this error

lyseiha commented 4 years ago

+1

salman1696 commented 3 years ago

+1

zoobibackups commented 2 years ago
react-native-maps-directions Error on GMAPS route request, ZERO_RESULTS
- node_modules\react-native\Libraries\YellowBox\YellowBox.js:71:8 in console.warn
- node_modules\expo\build\environment\muteWarnings.fx.js:18:23 in warn
- node_modules\react-native-maps-directions\src\MapViewDirections.js:266:10 in fetch.then.then._catch$argument_0
- node_modules\promise\setimmediate\core.js:37:14 in tryCallOne
- node_modules\promise\setimmediate\core.js:123:25 in setImmediate$argument_0
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:146:14 in _callTimer
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:194:17 in _callImmediatesPass
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:458:30 in callImmediates
* [native code]:null in callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:407:6 in __callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:143:6 in __guard$argument_0
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:384:10 in __guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:142:17 in __guard$argument_0
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

[Unhandled promise rejection: TypeError: undefined is not an object (evaluating '_ref.distance')]
- node_modules\react-native-maps-directions\src\MapViewDirections.js:184:26 in Promise.all.then$argument_0
* [native code]:null in reduce
- node_modules\react-native-maps-directions\src\MapViewDirections.js:182:22 in Promise.all.then$argument_0
- node_modules\promise\setimmediate\core.js:37:14 in tryCallOne
- node_modules\promise\setimmediate\core.js:123:25 in setImmediate$argument_0
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:146:14 in _callTimer
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:194:17 in _callImmediatesPass
- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:458:30 in callImmediates
* [native code]:null in callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:407:6 in __callImmediates
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:143:6 in __guard$argument_0
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:384:10 in __guard
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:142:17 in __guard$argument_0
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

This error is happening when you try to use a directions from one island to another

<MapViewDirection
          destination={destination}
          origin={origin}
          onReady={onReady}
          onError={onError}
          apikey={GOOGLE_API_KEY_PLACES}
          strokeWidth={3}
          optimizeWaypoints={true} // Billing?
          timePrecision={'now'}
          waypoints={[]}
      />

The onError isn't called else I would just handle the error there.

Same error no solution yet.

juanvelozo commented 1 year ago

I'm having this issue too, last entry here was two years ago, any solution?

raushan578 commented 1 year ago

But i am using same island , i mean country but error still remains

juanvelozo commented 1 year ago

I think I got it, I just declare it conditionally and didn't throw the error anymore

{coordenates && destinations ? (
        <MapViewDirections
          origin={{
            latitude: coordenates?.latitude || 0,
            longitude: coordenates?.longitude || 0,
          }}
          waypoints={destinations.map(dest => ({
            latitude: dest.latitude,
            longitude: dest.longitude,
          }))}
          language="ES"
          destination={{
            latitude: destinations[destinations.length - 1].latitude,
            longitude: destinations[destinations.length - 1].longitude,
          }}
          apikey={GOOGLE_MAPS_API_KEY}
          strokeWidth={5}
          resetOnChange={false}
          tappable={false}
          timePrecision="now"
          mode="DRIVING"
          strokeColor={theme.colors.accentblue[100]}
        />
      ) : null}

Hope this helps.

lapleDF commented 5 months ago

have you found any solution yet?

ijs1103 commented 2 months ago

same issue in RN 0.74