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.
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.
func minZoom() -> Int32
Maximum zoom level (e.g. 17)
The maximum zoom level you can provide.
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.
- (void)startFetchForTile:(MaplyTileID)tileID forLayer:(MaplyQuadPagingLayer *_Nonnull)layer;
The tile the system wants you to start loading.
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.
- (void)getBoundingBox:(MaplyTileID)tileID ll:(MaplyCoordinate3dD *_Nonnull)ll ur:(MaplyCoordinate3dD *_Nonnull)ur;
optional func getBoundingBox(_ tileID: MaplyTileID, ll: UnsafeMutablePointer
Lower left corner. This is already filled in with default information.
Upper right corner. This is already filled in with default information.