I'm using GMSMapView for an iPad app. I want to display custom tiles in the map but I couldn't.
I've created custom TileLayer.h
#import <GoogleMaps/GoogleMaps.h>
@interface TileLayer : GMSSyncTileLayer
@end
and TileLayer.m
#import "TileLayer.h"
@implementation TileLayer
-(UIImage *) tileForX:(NSUInteger)x y:(NSUInteger)y zoom:(NSUInteger)zoom {
NSLog(@"tile");
}
@end
in the 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 command never executed. What is wrong?