MaplyRemoteTileInfoProtocol
Undocumented
-
The coordinate system the image pyramid is in.
This is typically going to be MaplySphericalMercator with the web mercator extents. That’s what you’ll get from OpenStreetMap and, often, MapBox. In other cases it might be MaplyPlateCarree, which covers the whole earth. Sometimes it might even be something unique of your own.
Declaration
Objective-C
- (MaplyCoordinateSystem *_Nullable)coordSys;
Swift
func coordSys() -> MaplyCoordinateSystem?
-
The minimum zoom level available.
This is the lowest level we’ll try to fetch. Any levels below that will be filled in with placeholders. Those are empty, but they allow us to load tiles beneath.
Declaration
Objective-C
- (int)minZoom;
Swift
func minZoom() -> Int32
-
The maximum zoom level available.
This is the highest level (e.g. largest) that we’ll fetch for a given pyramid tile source. The source can sparse, so you are not required to have these tiles available, but this is as high as the MaplyQuadImageTilesLayer will fetch.
Declaration
Objective-C
- (int)maxZoom;
Swift
func maxZoom() -> Int32
-
Number of pixels on a side for any given tile.
This is the number of pixels on any side for a given tile and it’s typically 128 or 256. This is largely a hint for the screen space based pager. In most cases you are not required to actually return an image of the size you specify here, but it’s a good idea.
Declaration
Objective-C
- (int)pixelsPerSide;
Swift
func pixelsPerSide() -> Int32
-
Generate the request for a given tile.
If someone outside of this request wants to fetch the data directly, they can do so by using this NSURLRequest.
Declaration
Objective-C
- (nullable NSURLRequest *)requestForTile:(MaplyTileID)tileID;
Swift
func request(forTile tileID: MaplyTileID) -> URLRequest?
Parameters
tileID
The tile we’d like the NSURLRequest for.
Return Value
An NSURLRequest object you can use to fetch data for the tile.
-
Check if a given tile is stored in the local cache.
This checks if the given tile ID is represented in the local cache directory.
Declaration
Objective-C
- (_Bool)tileIsLocal:(MaplyTileID)tileID frame:(int)frame;
Swift
func tileIsLocal(_ tileID: MaplyTileID, frame: Int32) -> Bool
Parameters
tileID
The tile we’d like to check for.
frame
If you’re loading individual frames this will be the frame. Otherwise, -1.
-
Check if we should even try to load a given tile.
Check whether tile level is within zoom limits for the source, and if the tile is within any MBRs that have been added.
Declaration
Objective-C
- (_Bool)validTile:(MaplyTileID)tileID bbox:(MaplyBoundingBox)bbox;
Swift
func validTile(_ tileID: MaplyTileID, bbox: MaplyBoundingBox) -> Bool
Parameters
tileID
The tile we’re asking about.
bbox
The bounding box of the tile we’re asking about, for convenience.
Return Value
True if the tile is loadable, false if not.
-
Read a tile from your local cache.
If you have a cache, read the tile from that cache and return it. This is a synchronous call.
If you don’t have a cache, just return nil.
Declaration
Objective-C
- (NSData *_Nullable)readFromCache:(MaplyTileID)tileID;
Swift
func read(fromCache tileID: MaplyTileID) -> Data?
Parameters
tileID
The tile to read from your cache.
-
Write a given data tile to your local cache.
With this call, you’re supposed to write the tile, which has presumably been fetched remotely to your own cache.
If you don’t have a cache, don’t do anything.
Declaration
Objective-C
- (void)writeToCache:(MaplyTileID)tileID tileData:(NSData *_Nonnull)tileData;
Swift
func write(toCache tileID: MaplyTileID, tileData: Data)
Parameters
tileID
Tile to write to cache.
tileData
Data for tile.