-
Notifications
You must be signed in to change notification settings - Fork 14
Add color legend support to ktile raster layer #451
Conversation
Should there be a legend even when the colors aren't custom? Also, it seems like there should be a way to modify the default -- for instance, if I want a black-to-white continuous scale with different min and max values. |
@matthewma7 do you have an answer for @manthey's question above? |
@aashish24 I meant to ask @dorukozturk when I got a chance. |
@matthewma7 Here they list bunch of options. I think your options are
"The colorizer also has default color, which input values will be converted to if they don't match any stops. |
greyscale is assumed when there is only one band. You can look into QGIS which is the industry standard tool. greyscale would be continuous (think of height map) |
After a discussion with @aashish24, we decided to implement legend for default raster styling in the separate PR, because it might involve something with some complexity outside the current changes. |
layer.url((x, y, z) => `${url}/${z}/${x}/${y}`); | ||
} else { | ||
layer.url((x, y, z) => `${url}/${z}/${x}/${y}?palette=${visProperties.palettable}&band=${visProperties.band}&minimum=${visProperties.min}&maximum=${visProperties.max}`); |
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.
possible to wrap this long line?
LGTM if @manthey also approves it. |
} else { | ||
layer.url((x, y, z) => `${url}/${z}/${x}/${y}? | ||
palette=${visProperties.palettable}&band=${visProperties.band}& | ||
minimum=${visProperties.min}&maximum=${visProperties.max}`); |
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.
Unbreak this line or change how it is generated. The extra spaces and newlines mess up the query parameters. This should work instead:
layer.url((x, y, z) => `${url}/${z}/${x}/${y}?` +
`palette=${visProperties.palettable}&band=${visProperties.band}&` +
`minimum=${visProperties.min}&maximum=${visProperties.max}`);
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.
Oh, yes. I was carried away with the multiline support of template literals.
And some code refactoring