mustAvoidLinkIds not working

2 posts / 0 new
Last post
mustAvoidLinkIds not working

I'm attempting to generate directions from a location in the City of Syracuse, NY to another destination in Syracuse that specifically avoids travel on Route 81 through the city.

I obtained a link ID for Route 81 via this API call:[key-goes-here]&lat=43.03474&lng=-76.14298

I then make a call to the Directions API which includes this link ID like so:[key-goes-here]&json={%22locations%22:[%22224%20Sherbourne%20Rd,%20Syracuse,%20NY%2013224%22,%22231%20Salina%20Meadows%20Pkwy,%20Syracuse%22],%22options%22:{%22mustAvoidLinkIds%22:[25165036],%22shapeFormat%22:%22cmp6%22,%22conditionsAheadDistance%22:200,%22generalize%22:0},%22maxRoutes%22:1}

The directions returned route a traveler onto Route 81, the specific segment I am trying to avoid. I've tried multiple link IDs for Route 81 and for various on ramps from the origin destination but can not get the API to generate directions that avoid travel on Route 81.


This one worked great for me.
This one worked great for me. Keep in mind that it will avoid that point, not the entire road that the point is on. So it ends up on 81 for a portion, but avoids 81 at the point provided.{"locations":["224 Sherbourne Rd, Syracuse, NY 13224","231 Salina Meadows Pkwy, Syracuse"],"options":{"mustAvoidLinkIds":[15095513],"shapeFormat":"cmp6","conditionsAheadDistance":200,"generalize":0},"maxRoutes":1}   It looks like the lat/lng provided for the findlinkid request is on 81S which is not used in that route. Route control points may be a better option for avoiding 81.