react-native-maps-directions icon indicating copy to clipboard operation
react-native-maps-directions copied to clipboard

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

Open karimcambridge opened this issue 5 years ago • 10 comments

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.

karimcambridge avatar Mar 25 '20 01:03 karimcambridge

how to solvev this error

sooraj-panchal avatar Apr 03 '20 07:04 sooraj-panchal

+1

lyseiha avatar Apr 17 '20 15:04 lyseiha

+1

salman1696 avatar Nov 16 '20 13:11 salman1696

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.

zoobibackups avatar Dec 23 '21 05:12 zoobibackups

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

juanvelozo avatar Jul 03 '23 20:07 juanvelozo

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

raushan578 avatar Jul 11 '23 08:07 raushan578

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.

juanvelozo avatar Jul 12 '23 23:07 juanvelozo

have you found any solution yet?

lapleDF avatar Mar 20 '24 09:03 lapleDF