Skip to content

Commit

Permalink
Custom palette issues
Browse files Browse the repository at this point in the history
  • Loading branch information
christof-wittreich committed Jan 10, 2024
1 parent a4ef582 commit 374a0f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions web/js/containers/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,12 @@ const mapDispatchToProps = (dispatch) => ({
promises.push(promiseImageryForTour(layers, parameters.t1, 'activeB'));
}
}
preloadPalettes(layers, {}, false).then((obj) => {
dispatch({
type: BULK_PALETTE_RENDERING_SUCCESS,
rendered: obj.rendered,
});
});
await Promise.all(promises);
},
startTour: () => {
Expand Down
2 changes: 1 addition & 1 deletion web/js/map/layerbuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default function mapLayerBuilder(config, cache, store) {
if (isVectorStyleActive(def.id, activeGroupStr, state)) {
style = getVectorStyleKeys(def.id, undefined, state);
}
if (options.style) {
if (def.custom && options.style) {
style = options.style;
}
return [layerId, projId, date, style, activeGroupStr].join(':');
Expand Down
5 changes: 3 additions & 2 deletions web/js/modules/palettes/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,16 @@ export function getKey(layerId, groupStr, state) {
return '';
}
const def = getPalette(layerId, undefined, groupStr, state);
const { values } = getPalette(layerId, 0, groupStr, state).entries;
const keys = [];
if (def.custom) {
keys.push(`palette=${def.custom}`);
}
if (def.min) {
keys.push(`min=${def.min}`);
keys.push(`min=${getMinValue(values[def.min])}`);
}
if (def.max) {
keys.push(`max=${def.max}`);
keys.push(`max=${getMinValue(values[def.max])}`);
}
if (def.squash) {
keys.push('squash');
Expand Down

0 comments on commit 374a0f9

Please sign in to comment.