# GoogleMaps Framework Reference

# GMSURLTileLayer

    @interface GMSURLTileLayer : https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSTileLayer.html

`GMSURLTileProvider` fetches tiles based on the URLs returned from a `https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Type-Definitions/GMSTileURLConstructor.html`. For
example:

```
   GMSTileURLConstructor constructor = ^(NSUInteger x, NSUInteger y, NSUInteger zoom) {
     NSString *URLStr =
         [NSString stringWithFormat:@"https://example.com/%d/%d/%d.png", x, y, zoom];
     return [NSURL URLWithString:URLStr];
   };
   GMSTileLayer *layer =
       [GMSURLTileLayer tileLayerWithURLConstructor:constructor];
   layer.userAgent = @"SDK user agent";
   layer.map = map;
 
```

<br />

`GMSURLTileProvider` may not be subclassed and should only be created via its convenience
constructor.
- `


  ### [+tileLayerWithURLConstructor:](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSURLTileLayer#/c:objc(cs)GMSURLTileLayer(cm)tileLayerWithURLConstructor:)


  ` Convenience constructor. `constructor` must be non-nil.

  #### Declaration

  Swift

      convenience init(urlConstructor constructor: @escaping https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Type-Definitions/GMSTileURLConstructor.html)

  Objective-C

      + (nonnull instancetype)tileLayerWithURLConstructor:
          (nonnull https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Type-Definitions/GMSTileURLConstructor.html)constructor;

- `


  ### [userAgent](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSURLTileLayer#/c:objc(cs)GMSURLTileLayer(py)userAgent)


  ` Specify the user agent to describe your application. If this is nil (the default), the default
  iOS user agent is used for HTTP requests.

  #### Declaration

  Swift

      var userAgent: String? { get set }

  Objective-C

      @property (nonatomic, copy, nullable) NSString *userAgent;