MaplyElevationSourceDelegate

@protocol MaplyElevationSourceDelegate

Elevation Source Delegate provides elevation data for a given tile.

The Elevation Source Delegate provides elevation data on demand for a given tile. It returns a MaplyElevationChunk or nil if no data is available. Your delegate may be called on a random thread, so act accordingly.

This object is probably being used in conjuction with a MaplyTileSource, but is treated separately. We may reuse the same elevation source for multiple image pyramids and they tend not to be packaged together.

  • Return the coordinate system we’re using.

    The coordinate system used by the elevation source delegate should match any associated MaplyTileSource objects. The toolkit won’t check that, so it’s up to you.

    The coordinate system is probably MaplySphericalMercator.

    Declaration

    Objective-C

    - (nullable MaplyCoordinateSystem *)getCoordSystem;

    Swift

    func getCoordSystem() -> MaplyCoordinateSystem?
  • The minimum zoom level this delegate can provide.

    The min zoom level should probably be 0 or at least match your MaplyTileSource objects.

    Declaration

    Objective-C

    - (int)minZoom;

    Swift

    func minZoom() -> Int32
  • The maximum zoom level this delegate can provide.

    The max zoom level is not a requirement. The elevation pyramid can be sparse, just as the image pyramid can be.

    The MaplyQuadImageTilesLayer has an option to not display image tiles that don’t have corresponding elevation. In other words, the image display will cut off when there’s no more elevation.

    Declaration

    Objective-C

    - (int)maxZoom;

    Swift

    func maxZoom() -> Int32
  • Return the elevation samples for a given tile.

    Your delegate can return elevation data for the given tile or nil if no data was available. Elevation is in meters and data values are 32 bit floats.

    Declaration

    Objective-C

    - (nullable MaplyElevationChunk *)elevForTile:(MaplyTileID)tileID;

    Swift

    func elev(forTile tileID: MaplyTileID) -> MaplyElevationChunk?
  • Return true if the data is local to the device.

    Let us know if the data is local or remote. This is a hint to the pager and will be called before elevForTile:. If you don’t know, just return false.

    Declaration

    Objective-C

    - (_Bool)tileIsLocal:(MaplyTileID)tileID frame:(int)frame;

    Swift

    func tileIsLocal(_ tileID: MaplyTileID, frame: Int32) -> Bool