-
-
Notifications
You must be signed in to change notification settings - Fork 40
Add RasterDemSource #652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add RasterDemSource #652
Conversation
Currently implemented for Android only
| options: TileSetOptions, | ||
| tileSize: Int, | ||
| ) : super() { | ||
| this.impl = TODO() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe at least use TODO("Not implemented") or similar for clarity, after all, a TODO produces a runtime exception if that code is reached, IIRC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JS documentation would be here:
https://maplibre.org/maplibre-gl-js/docs/API/classes/RasterDEMTileSource/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the iOS documentation: https://maplibre.org/maplibre-native/ios/latest/documentation/maplibre/mlnrasterdemsource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raster DEM sources have the additional property encoding which is missing here. Could be represented with
/** The encoding used by a Raster DEM source. */
public sealed interface RasterDemEncoding {
/** Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info */
public data object Mapbox : RasterDemEncoding
/** Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info. */
public data object Terrarium : RasterDemEncoding
/**
Custom format using the given [redFactor], [blueFactor], [greenFactor] and [baseShift] parameters.
Currently only supported in JS.
*/
public data class Custom(
/** Value that will be multiplied by the red channel value when decoding. */
val redFactor: Float = 1f,
/** Value that will be multiplied by the blue channel value when decoding. */
val blueFactor: Float = 1f,
/** Value that will be multiplied by the green channel value when decoding. */
val greenFactor: Float = 1f,
/** Value that will be added to the encoding mix when decoding. */
val baseShift: Float = 0f,
) : RasterDemEncoding
}
Description
Adds the RasterDemSource, which is used by HillshadeLayer. Currently Android-only because I don't own a Mac PC.
Test plan
Confirmed working with this snippet (it renders hills around Austria)
Checklist
To your knowledge, are you making any breaking changes?
No
Have you tested the changes? On which platforms?