API Excel for Bing Map for China?

Antonio D'Ammaro 1 Reputation point
2022-06-29T16:00:08.997+00:00

Hello,

I developed an Excel tool which estimates the driving distance between two coordinates. The tool uses an API linked to Bing Maps, and the tutorial: link

I have tested the tool for many countries, and it works, but the tool fail to estimate distances in China, providing a negative distance.

The driving distance works on Bing Maps, but not on the API. For example: Start [31.2856, 120.7490], End [31.3750,120.6476].

Would you be able to help out, please?

Cheers,

Antonio

Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
245 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,480 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. IoTGirl 2,976 Reputation points Microsoft Employee
    2022-06-29T22:21:59.493+00:00

    Hi Antonio,

    Can you please provide the sample call with your Bing Maps key removed?

    Sincerely,
    IoTGirl

    0 comments No comments

  2. Antonio D'Ammaro 1 Reputation point
    2022-06-30T08:41:37.63+00:00

    Hello IoTGirl,

    I cannot attach Excel file here, so left as a link: https://1drv.ms/x/s!AkOoIOhz1PlvgtcRrwHmYzPx1sNizA?e=eBlFSk.

    The file does not have a key, as it is attached to my account. You can get it from https://www.bingmapsportal.com/. Process explained here: https://chandoo.org/wp/distance-between-places-excel-maps-api/
    There are three examples: EU to EU, China to China, and Russia to China.
    I hope someone from this forum can help in understanding why Bing Maps in this API provides a negative distance whenever a coordinate in China is placed.

    Cheers,
    Antonio

    0 comments No comments

  3. IoTGirl 2,976 Reputation points Microsoft Employee
    2022-08-04T21:30:43.597+00:00

    Hi Antonio,

    As you have still not provided the exact call, without the key, I am unable to assist you. Please note that the web experience uses the Browser values and locale settings which you may have neglected in your calls but without a sample of the call, outside of excel, I have no way to support your Maps API usage.

    Sincerely,
    IoTGirl


  4. IoTGirl 2,976 Reputation points Microsoft Employee
    2022-08-05T23:56:47.453+00:00

    Hi Antonio,

    You are asking for a "Distance Matrix" so that is the wrong call. Try https://learn.microsoft.com/en-us/bingmaps/rest-services/routes/calculate-a-route or http://dev.virtualearth.net/REST/V1/Routes?wp.0=39.90208, 116.718521&wp.1=31.2983, 120.5832&key={BingMapsKey}

    You will note that the call you are using is expecting "Origins" meaning a list of multiple origins and Destinations so it is not for a single set.

    Sincerely,
    IoTGirl