-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't Display Truck Route Directions #23
Comments
I tested this in my own code and it solves my use case's problem. I can now view truck routes in my map! :) |
@iniamudhan Any chance I can get an approval on this? My code needs to go into QA soon and I don't really want to make my own spin-off of your repo just for this one line fix. |
My code needs to go into QA today, it turns out. In the meantime, I've created this package with this fix in it. Currently, there are no other differences. |
How are you able to get truck routes to show? I can do driving and transit, but when I change routeMode to truck I get an error: "errorDetails": [ |
I've been messing with the Bing Maps API with Postman and comparing what react-bingmaps is sending and it appears that for whatever reason, when
routeMode
is set totruck
, Bing Maps will return an error ifisViaPoint
is set tonull.
I've tried to set it totrue
,1
,0
,"1"
,"0"
,"true"
, "false"`, but any falsy value is being automatically set to null in the code.An easy fix would be to replace this:
var isViaPoint = wayPoints[wayPointsIndex].isViaPoint ? wayPoints[wayPointsIndex].isViaPoint : null;
with this:
var isViaPoint = wayPoints[wayPointsIndex].isViaPoint !== undefined ? wayPoints[wayPointsIndex].isViaPoint : null;
That way, users can pass falsy values and it will be passed on to the Bing Maps API as they intend.
Alternatively, if anyone knows how to get this to work without modifying the repo, I'm all ears.
The text was updated successfully, but these errors were encountered: