MaplyPagingDelegate
@protocol MaplyPagingDelegate
The paging delegate is used by the paging layer to load tiles.
The Maply Paging Delegate is used by the MaplyQuadPagingLayer to do feature (e.g. not image) paging. You set up an object that implements this protocol and talks to the paging layer. This is how you load things like vector tiles.
It’s up to you to do the actual loading of tiles and turn the data into Maply features. Once you do that, the paging layer will handle the rest.
See
MaplyQuadPagingLayer-
Minimum zoom level (e.g. 0)
The minimum zoom level you can provide. If you’ve only got one level of data, just return minZoom and maxZoom with the same value.
Declaration
Objective-C
- (int)minZoom;
Swift
func minZoom() -> Int32
-
Maximum zoom level (e.g. 17)
The maximum zoom level you can provide.
Declaration
Objective-C
- (int)maxZoom;
Swift
func maxZoom() -> Int32
-
Start fetching data for the given tile.
The paging layer calls this method to let you know you should start fetching data for a given tile. This will not be called on the main thread so be prepared for that.
You should immediately do an async call to your own loading logic and then merge in your results. If you do your loading calls in line you’ll slow down the loading thread. After you’re done you MUST call tileDidLoad in the layer, even for failures.
Once you’ve loaded your data, you need to create the corresponding Maply objects in the view controller and pass them back to the paging layer for tracking.
Declaration
Objective-C
- (void)startFetchForTile:(MaplyTileID)tileID forLayer:(MaplyQuadPagingLayer *_Nonnull)layer;
Swift
func startFetch(forTile tileID: MaplyTileID, for layer: MaplyQuadPagingLayer)
Parameters
tileID
The tile the system wants you to start loading.
layer
The quad paging layer you’ll hand the data over to when it’s loaded.
-
Return a custom bounding box for importance calculation.
This is an optional method that can be used to provide a custom bounding box for a given tile.
If you’re going to use this, please make the tile smaller. Bigger tiles may not work correctly.
This is intended to allow 3D loading calculations to work better with divergent height data.
Declaration
Objective-C
- (void)getBoundingBox:(MaplyTileID)tileID ll:(MaplyCoordinate3dD *_Nonnull)ll ur:(MaplyCoordinate3dD *_Nonnull)ur;
Swift
optional func getBoundingBox(_ tileID: MaplyTileID, ll: UnsafeMutablePointer
Parameters
ll
Lower left corner. This is already filled in with default information.
ur
Upper right corner. This is already filled in with default information.
-
An optional callback when a tile is unloaded.
If filled in, you’ll be called when a tile is unloaded.
Declaration
Objective-C
- (void)tileDidUnload:(MaplyTileID)tileID;
Swift
optional func tileDidUnload(_ tileID: MaplyTileID)