问题
I'm writing an application with the here sdk and I have routes with a lot of stop overs (> 100) and I need to make sure that the driver goes through all of them.
For that I :
- get the list of stopovers from the MapRoute#getRoute()#getManeuvers() method after planning.
- listen to the NewInstructionEventListener#onNewInstructionEvent() to know when the driver has reached a stopover.
Problem is that sometimes, I don't receive the event even if the driver has reached it.
I was able to reproduce this issue in simulation mode and I believe it is linked to the driving speed. My belief is that when the vehicle goes to fast, no instruction is generated for the stopover maneuver.
I don't know how to work around this problem. Is there a way to get a "stopover reached" event. (I would prefer to avoid using the positionmanager and compute the distance to the stopovers)
Thank you.
回答1:
Unfortunately the onNewInstructionEvent
callback cannot be relied on for this use case. Your assessment is correct, based on speed and other factors you may not get the callback in all cases.
The ability to tune the parameters for triggering onNewInstructionEvent
callback are not exposed as part of the SDK. You will have to investigate other approaches for achieving your use case such as distance solution you mentioned.
来源:https://stackoverflow.com/questions/37836266/newinstructioneventlistener-skipping-some-stop-over-maneuvers