MaplyRemoteTileInfoNew

Objective-C

@interface MaplyRemoteTileInfoNew : NSObject <MaplyTileInfoNew>

Swift

class MaplyRemoteTileInfoNew : NSObject, MaplyTileInfoNew

Remote Tile Info Object (New)

Not to be confused with the old one, which works with the older loading subsystem, the new remote tile info object contains min/max zoom, coordinate system and URL information for fetching individual data tiles.

  • Initialize with enough information to fetch remote tiles.

    This version of the init method takes all the explicit information needed to fetch remote tiles. This includes the base URL and min and max zoom levels.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithBaseURL:(NSString *_Nonnull)baseURL
                                    minZoom:(int)minZoom
                                    maxZoom:(int)maxZoom;

    Swift

    init(baseURL: String, minZoom: Int32, maxZoom: Int32)

    Parameters

    baseURL

    The base URL for fetching TMS tiles. This is a replacement URL with {x}, {y}, and {z} in the string.

    minZoom

    The minimum zoom level to fetch. This really should be 0.

    maxZoom

    The maximum zoom level to fetch.

    Return Value

    The MaplyRemoteTileInfoNew object or nil on failure.

  • Base URL

    Declaration

    Objective-C

    @property (nonatomic, retain, readonly, nonnull) NSString *baseURL;

    Swift

    var baseURL: String { get }
  • Min zoom level

    Declaration

    Objective-C

    @property (nonatomic, readonly) int minZoom;

    Swift

    var minZoom: Int32 { get }
  • Max zoom level

    Declaration

    Objective-C

    @property (nonatomic, readonly) int maxZoom;

    Swift

    var maxZoom: Int32 { get }
  • The timeout assigned to the NSMutableURLRequest we’re using to fetch tiles.

    This is not set by default. If set, we’ll use this value as the timeout on the NSMutableURLRequest we use for fetching tiles. This lets you extent it where appropriate or shorten it if you like.

    Declaration

    Objective-C

    @property (nonatomic) float timeOut;

    Swift

    var timeOut: Float { get set }
  • The cache directory for data tiles.

    In general, we want to cache. The globe, in particular, is going to fetch the same tiles over and over, quite a lot. The cacheing behavior is a little dumb. It will just write files to the given directory forever. If you’re interacting with a giant image pyramid, that could be problematic.

    Declaration

    Objective-C

    @property (nonatomic, retain, nullable) NSString *cacheDir;

    Swift

    var cacheDir: String? { get set }
  • Optional headers to add to the NSURLRequest.

    These are name/data pairs which will be stuck in the NSURLRequest header.

    Declaration

    Objective-C

    @property (nonatomic, retain) NSDictionary *_Nullable headers;

    Swift

    var headers: [AnyHashable : Any]? { get set }
  • Optional coordinate system describing the tile set.

    This coordinate system is required if the tile info will need to evaluate valid tiles as defined by the addValidBounds:coordSystem: call.

    Declaration

    Objective-C

    @property (nonatomic, retain) MaplyCoordinateSystem *_Nullable coordSys;

    Swift

    var coordSys: MaplyCoordinateSystem? { get set }
  • Add a bounding box that defines validity for any tile before it’s fetched.

    Not all data sources cover all possible tiles. If you know your data source does not, you can specify what area is valid ahead of times. Tiles that do not overlap that area will not be loaded.

    Declaration

    Objective-C

    - (void)addValidBounds:(MaplyBoundingBoxD)bbox
               coordSystem:(MaplyCoordinateSystem *_Nonnull)coordSys;

    Swift

    func addValidBounds(_ bbox: MaplyBoundingBoxD, coordSystem coordSys: MaplyCoordinateSystem)