gpt4 book ai didi

iphone - 没有 Google 图层的 MKMapView

转载 作者:行者123 更新时间:2023-12-03 21:20:54 26 4
gpt4 key购买 nike

使用 MKMapView 时是否有某种方法可以禁用 Google 图层?我打算自己提供所有瓷砖。

目前我的看法是,我必须选择我的 map 使用哪种类型的 Google 数据,但无法完全关闭它。

更新只是重申一下。我根本不希望我的应用程序联系 Google。不应收到任何 map 图像,因此我认为我没有受到他们许可协议(protocol)的影响。

最佳答案

从 iOS 7 开始,这很容易做到。此代码(您可以将其放置在 viewDidLoad: 方法中)将在应用程序包的 map-tiles/ 文件夹中查找图 block :

NSString *baseURL = [[[NSBundle mainBundle] bundleURL] absoluteString];
NSString *template = [baseURL stringByAppendingString:@"map-tiles/{z}/{x}/{y}.png"];
MKTileOverlay *overlay = [[MKTileOverlay alloc] initWithURLTemplate:template];
overlay.canReplaceMapContent = YES;
[self.mapView addOverlay:overlay level:MKOverlayLevelAboveLabels];

This page详细介绍了如何下载 OpenStreetMap 切片以供离线使用。

关于iphone - 没有 Google 图层的 MKMapView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4980583/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com