【问题标题】:Bing maps url not downloading tiles and throws security exceptionBing 地图 url 不下载图块并引发安全异常
【发布时间】:2019-12-23 10:18:23
【问题描述】:

我正在从 Bing 地图服务器下载图块。使用下面的 Url,它在 Android 和 UWP 平台上运行良好。但是在 iOS 中抛出异常“System.Net.WebException: The resource could not be loaded because the App Transport Security policy requires the use of a secure connection”。

必应网址:
http://dev.virtualearth.net/REST/V1/Imagery/Metadata/Road?output=json&include=providers&key= 我尝试了以下解决方案(堆栈溢出链接),但它不起作用。然后,我将 http 更改为 https(安全 URL)。它工作正常,并且从 Bing 服务器下载了图块。

App Transport Security policy requires the use of a secure connection - IOS 9

我们是否只需要在 iOS 平台上使用安全 URL (https:) 来从 Bing 服务器下载图块?但是,打开使用 http 的街道地图 Url。

任何人请提供确切的解决方案,为什么应该在 iOS 中为 Bing 地图图块使用安全 url。?

问候, 婆罗洲

【问题讨论】:

标签: ios xamarin.ios bing-maps


【解决方案1】:

如果您直接下载切片,最佳做法是从此处记录的图像元数据服务中获取切片的 URL: https://docs.microsoft.com/en-us/bingmaps/rest-services/imagery/get-imagery-metadata 如果您想使用 SSL(推荐),请确保使用 uriScheme=https。

请注意,地图控件(现在可在 iOS 和 Android 以及 UWP 本地使用)自动处理此问题,并且比直接使用图块更容易使用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多