GMSURLTileLayer.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 =
  23. * [NSString stringWithFormat:@"https://example.com/%d/%d/%d.png", x, y, zoom];
  24. * return [NSURL URLWithString:URLStr];
  25. * };
  26. * GMSTileLayer *layer =
  27. * [GMSURLTileLayer tileLayerWithURLConstructor:constructor];
  28. * layer.userAgent = @"SDK user agent";
  29. * layer.map = map;
  30. * </pre>
  31. *
  32. * GMSURLTileProvider may not be subclassed and should only be created via its
  33. * convenience constructor.
  34. */
  35. @interface GMSURLTileLayer : GMSTileLayer
  36. /** Convenience constructor. |constructor| must be non-nil. */
  37. + (instancetype)tileLayerWithURLConstructor:(GMSTileURLConstructor)constructor;
  38. /**
  39. * Specify the user agent to describe your application. If this is nil (the
  40. * default), the default iOS user agent is used for HTTP requests.
  41. */
  42. @property(nonatomic, copy) NSString *userAgent;
  43. @end