Bing Maps API - Routing issue, tunnel height.

Dev 216 Reputation points

I have a routing issue.

Using the following code:

                var map = new Microsoft.Maps.Map(document.getElementById('myMapTruckRoutes'), {
                    /* No need to set credentials if already passed in URL */
                    center: new Microsoft.Maps.Location(40.73095867476664, -74.04670184835668),
                    zoom: 16
                Microsoft.Maps.loadModule('Microsoft.Maps.Directions', function () {
                    var directionsManager = new Microsoft.Maps.Directions.DirectionsManager(map);
                    directionsManager.setRenderOptions({ itineraryContainer: document.getElementById('printoutPanel') });
                        routeMode: Microsoft.Maps.Directions.RouteMode.truck,
                        vehicleSpec: {
                            dimensionUnit: 'ft',
                            vehicleHeight: 10
                    var wp1 = new Microsoft.Maps.Directions.Waypoint({
                    //address: "Washington Blvd.",
                        location: new Microsoft.Maps.Location(40.73095867476664, -74.04670184835668)

                    var wp2 = new Microsoft.Maps.Directions.Waypoint({
                    //address: "W Side Hway.",
                        location: new Microsoft.Maps.Location(40.7249546323,-74.0110042)


I am expecting, due to the vehicle height that this will reroute via Holland Tunnel which has an allowed height of 12"6. However, the tunnel is avoided and a much longer route selected.

Any ideas why it would avoid Holland Tunnel?

If I set RouteMode to 'car' it routes as expected and uses Holland Tunnel.

Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
250 questions
0 comments No comments
{count} votes

Accepted answer
  1. IoTGirl 2,976 Reputation points Microsoft Employee

    Hi Iain,

    I am not familiar with the Holland Tunnel specifically but are there other restrictions that might block a commercial vehicle from being allowed through that tunnel? Often it is a separate restriction, rather than just height that can cause a reroute.

    A quick search for gives a third result that "Holland Tunnel The following restrictions are in place until further notice: In Both Directions: NO TRACTOR-TRAILERS, THREE-AXLE DUAL-UNIT TRUCKS, OR TRUCKS WITH FOUR OR MORE AXLES. Only two and three-axle single-unit trucks allowed. "

    You may need to provide a clearer definition of the vehicle as I believe truck routing will err on the side of caution if a value is not defined.


    0 comments No comments

0 additional answers

Sort by: Most helpful