无法从 Bing 地图 API 获取位置

问题描述 投票:0回答:1

我正在使用 Bing Map API 从地址获取纬度和经度

https://dev.virtualearth.net/REST/v1/Locations?q=100+Somerset+St+New+Brunswick+NJ+08901&key={BingKey}

获取“authenticationResultCode”:“ValidCredentials”纬度和经度为40.486216,-74.451819。 但是,当我使用相同的 Bing MAP API 密钥从纬度和经度获取我的位置详细信息时,我得到

https://dev.virtualearth.net/REST/v1/locationrecog/40.486216,-74.451819?key={BingKey}&output=json

获取无效凭证

{"authenticationResultCode":"InvalidCredentials","brandLogoUri":"https:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2024 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":"74c389b15e4e447ba1baf0089141d813|BN00006C5D|0.0.0.1"}

我在这里做错了什么。请帮忙。

bing-maps
1个回答
0
投票

我尝试了您提供的查询,它与我的密钥配合得很好。仔细检查 URL 中的密钥,复制/粘贴时很容易忘记某个字符(这些年来我多次遇到这种情况)。

© www.soinside.com 2019 - 2024. All rights reserved.