-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Adds support for mapzen terrain #6110
Conversation
Looks great! You guys have such a nice project structure. Great work! |
@ibesora here is the gl-native equivalent mapbox/mapbox-gl-native#11154 |
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.
🆒 looks good to me! Couple of nitpicks inline
src/data/dem_data.js
Outdated
@@ -57,22 +57,14 @@ class DEMData { | |||
this.loaded = !!data; | |||
} | |||
|
|||
loadFromImage(data: RGBAImage) { | |||
loadFromImage(data: RGBAImage, encoding?: "mapbox" | "terrarium") { |
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.
encoding
can be non-optional here
@@ -21,11 +21,12 @@ class RasterDEMTileWorkerSource { | |||
} | |||
|
|||
loadTile(params: WorkerDEMTileParameters, callback: WorkerDEMTileCallback) { | |||
const uid = params.uid; | |||
const uid = params.uid, | |||
encoding = params.encoding || "mapbox"; |
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 || "mapbox"
shouldn't be needed since WorkerDemTileParameters.encoding
is required.
* Added the encoding parameter to the raster-dem source type * Changes proposed by @mollymerp * Changed the raster-dem description and expanded the encoding parameter one * Changed the description in the style spec reference * Fixes linter errors * Changed ts type * Proposed changes * Bug * Added a default value when the RasterDEMTileWorkerSource is called without params * Adds default value to pass unit tests * Explicit encoding type and _ to private functions * add guard for invalid encoding parameter and unit test * add terrarium render test * address review comments
* Added the encoding parameter to the raster-dem source type * Changes proposed by @mollymerp * Changed the raster-dem description and expanded the encoding parameter one * Changed the description in the style spec reference * Fixes linter errors * Changed ts type * Proposed changes * Bug * Added a default value when the RasterDEMTileWorkerSource is called without params * Adds default value to pass unit tests * Explicit encoding type and _ to private functions * add guard for invalid encoding parameter and unit test * add terrarium render test * address review comments
continuing from @ibesora's work at #6024
@ibesora I rebased your PR and fixed the merge conflicts, and then I added a couple comments and tests 😊 . I don't have push access to your branch, so I made this new one (as I did with the maxzoom PR)