0
votes

When I am searching '藕舫路276号' in BING MAP, it is locating proper place. But when I am trying to invoke BING MAP REST API using the below request, I am not getting proper lat-long values.

http://dev.virtualearth.net/REST/v1/Locations?countryRegion=CN&addressLine=藕舫路276号&key={my-bing-key}

I have also tried below query, but its returning wrong location data.

http://dev.virtualearth.net/REST/v1/Locations?CountryRegion=CN&query=藕舫路276号&incl=queryParse&key={my-bing-key}

1

1 Answers

1
votes

You are mixing two different geocoding requests in one. structured and unstructured. query should only be used on it's own, when you add CountryRegion to the request, it might be interpreted as a structured request and the query parameter ignored.

Also try setting the culture parameter of the URL to zh-Hans or zh-Hant so that the geocoder knows your request is in Chinese and to call into the Chinese data provider for detailed Chinese map data.

Also, be sure to encode your query so that special characters don't cause issues in the request. This is a best practice.

Here is a modified version of your request.

http://dev.virtualearth.net/REST/v1/Locations?query=%E8%97%95%E8%88%AB%E8%B7%AF276%E5%8F%B7&incl=queryParse&culture=zh-Hans&key=