GMSURLTileLayer.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // GMSURLTileLayer.h
  3. // Google Maps SDK for iOS
  4. //
  5. // Copyright 2013 Google Inc.
  6. //
  7. // Usage of this SDK is subject to the Google Maps/Google Earth APIs Terms of
  8. // Service: https://developers.google.com/maps/terms
  9. //
  10. #import <GoogleMaps/GMSTileLayer.h>
  11. @class NSURL;
  12. /**
  13. * |GMSTileURLConstructor| is a block taking |x|, |y| and |zoom|
  14. * and returning an NSURL, or nil to indicate no tile for that location.
  15. */
  16. typedef NSURL *(^GMSTileURLConstructor)(NSUInteger x, NSUInteger y, NSUInteger zoom);
  17. /**
  18. * GMSURLTileProvider fetches tiles based on the URLs returned from a
  19. * GMSTileURLConstructor. For example:
  20. * <pre>
  21. * GMSTileURLConstructor constructor = ^(NSUInteger x, NSUInteger y, NSUInteger zoom) {
  22. * NSString *URLStr = [NSString stringWithFormat:@"http://example.com/%d/%d/%d.png", x, y, zoom];
  23. * return [NSURL URLWithString:URLStr];
  24. * };
  25. * GMSTileLayer *layer =
  26. * [GMSURLTileLayer tileLayerWithURLConstructor:constructor];
  27. * layer.userAgent = @"SDK user agent";
  28. * layer.map = map;
  29. * </pre>
  30. *
  31. * GMSURLTileProvider may not be subclassed and should only be created via its
  32. * convenience constructor.
  33. */
  34. @interface GMSURLTileLayer : GMSTileLayer
  35. /** Convenience constructor. |constructor| must be non-nil. */
  36. + (instancetype)tileLayerWithURLConstructor:(GMSTileURLConstructor)constructor;
  37. /**
  38. * Specify the user agent to describe your application. If this is nil (the
  39. * default), the default iOS user agent is used for HTTP requests.
  40. */
  41. @property(nonatomic, copy) NSString *userAgent;
  42. @end