0
我正在使用GMSMapView作爲iPad應用程序。我想在地圖上顯示自定義瓷磚,但我不能。iOS GMSSyncTileLayer不起作用
我創建定製TileLayer.h
#import <GoogleMaps/GoogleMaps.h>
@interface TileLayer : GMSSyncTileLayer
@end
和TileLayer.m
#import "TileLayer.h"
@implementation TileLayer
-(UIImage *) tileForX:(NSUInteger)x y:(NSUInteger)y zoom:(NSUInteger)zoom {
NSLog(@"tile");
}
@end
在MainView.m
viewMap.mapType = kGMSTypeNone;
GMSTileURLConstructor urls = ^(NSUInteger x, NSUInteger y, NSUInteger zoom) {
NSString *url = [NSString stringWithFormat:@"http://www.example.com/images/tile/%d_%d_%d.jpg",zoom,x,y];
return [NSURL URLWithString:url];
};
GMSURLTileLayer *layer = [GMSURLTileLayer tileLayerWithURLConstructor:urls];
layer.zIndex = 100;
layer.map = viewMap;
NSLog的命令永遠不會被執行。哪裏不對?