gpt4 book ai didi

objective-c - 使用 MKTileOverlay 和 MKTileOverlayRenderer

转载 作者:行者123 更新时间:2023-12-05 03:15:21 24 4
gpt4 key购买 nike

我正在尝试使用新的 iOS 7 beta 中提供的 MKTileOverlay 和 MKTileOverlayRenderer 在 Apple map View 上添加 Mapbox 切片图层或 Mapbox 服务器 map 。我将自己的信息放在我在网上找到的一些示例代码中,以在 map View 上加载服务器 map ,但它会产生一个错误,我需要一些帮助来解释。我收到错误,使用未声明的标识符“覆盖”。

//.h

@property (strong, nonatomic) IBOutlet MKMapView *mapView;


//.m

NSString *template = @"jbailo.Lighting/tile?z={z}&x={x}&y={y}";
overlay = [[MKTileOverlay alloc ] initWithURLTemplate:template];
overlay.canReplaceMapContent = YES;
[_mapView addOverlay:overlay level:MKOverlayLevelAboveRoads];


-(MKTileOverlayRenderer *)mapView:(MKMapView*)mapView rendererForOverlay:(id<MKOverlay>)overlay {

return [[MKTileOverlayRenderer alloc] initWithOverlay:overlay];

}

请告诉我应该将覆盖声明为什么,如果有人有使用这些 tileOverlays 方法的经验,请随时提出意见和建议。

最佳答案

看看:

https://github.com/mapbox/mbxmapkit

它已经解决了iOS7中Apple的MapKit与MapBox自定义 map 瓦片集成的问题。

关于objective-c - 使用 MKTileOverlay 和 MKTileOverlayRenderer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18580755/

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