none
Can not get address from map according to "Map Localization" RRS feed

  • Question

  • Hello,

    We trying to use bing map feature called "Map Localization", So we use following URL at the time of html page load

    https://www.bing.com/api/maps/mapcontrol?callback=getMap&setLang=de&setMkt=de&key=Bing Map Key

    After page load, map is loading localization wise (In German) which we provided in URL i.e setLang=de&setMkt=de (de used for German).

    But after that we are trying to fetch the address from map,So we use following API,

    http://dev.virtualearth.net/REST/v1/Locations/42.82806166525282,-99.51429113580055?key=Bing Map Key

    Addresses get fetched successfully but it fetches in English not in German, we also provide market parameter i.e setMkt=de as follow

    http://dev.virtualearth.net/REST/v1/Locations/42.82806166525282,-99.51429113580055?key=Bing Map Key&setLang=de&setMkt=de

    But same result is return i.e Addresses fetch in English Only.Is there any way to fetch Addressees from map according to Map Localization.

    Thanks 

    Friday, August 10, 2018 1:50 PM

Answers

All replies

  • Vikas,

    You should add the "c" culture parameter to your request to the locations API.  That should return you the results in the correct language.

    You can find more info at https://msdn.microsoft.com/en-us/library/ff701711.aspx, look for the culture parameter on this page.

    Justin

    Friday, August 10, 2018 5:56 PM
  • Hello,

    As per your solution we add "C" culture parameter to Location API Request as follows,

    http://dev.virtualearth.net/REST/v1/Locations/45.21340989866057,-91.86780676080055?c=de?key=Bing Map Key

    But we get following error

    {"authenticationResultCode":"InvalidCredentials","brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2018 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","errorDetails":["Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation."],"resourceSets":[],"statusCode":401,"statusDescription":"Unauthorized","traceId":"6036717bce1149c58af97aca6acf41c8|HK20300663|7.7.0.0"}

    After we remove "C" culture parameter  to Location API Request and check it,

    http://dev.virtualearth.net/REST/v1/Locations/45.21340989866057,-91.86780676080055?key=Bing Map Key

    We get following response in English only.

    {"authenticationResultCode":"ValidCredentials","brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2018 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":1,"resources":[{"__type":"Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1","bbox":[45.209547182429326,-91.875117195169565,45.217272617570679,-91.860496404830428],"name":"35 14th St, Dallas, WI 54763","point":{"type":"Point","coordinates":[45.2134099,-91.8678068]},"address":{"addressLine":"35 14th St","adminDistrict":"WI","adminDistrict2":"Barron Co.","countryRegion":"United States","formattedAddress":"35 14th St, Dallas, WI 54763","locality":"Dallas","postalCode":"54763"},"confidence":"Medium","entityType":"Address","geocodePoints":[{"type":"Point","coordinates":[45.2134099,-91.8678068],"calculationMethod":"Interpolation","usageTypes":["Display","Route"]}],"matchCodes":["Good"]}]}],"statusCode":200,"statusDescription":"OK","traceId":"a48cf11d214d48329c753f36dc5c6cdd|HK20240360|7.7.0.0|HK01EAP000001D8"}

    In both API Request we provide same Bing Map Key. Can you suggest me, if I am doing wrong way.

    Thank You.

    Tuesday, August 14, 2018 5:11 PM
  • Hi Vikas,

    Does http://dev.virtualearth.net/REST/v1/Locations/42.82806166525282,-99.51429113580055?key=<Bing Map Key>&c=de work for you? 

    Your call is failing because you are putting the parameter before the "?".  Parameters should be joined using an "&" after the "?".

    Sincerely,

    IoTGirl





    Tuesday, August 14, 2018 5:29 PM
    Owner