Skip to content
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

WV-2887 Preload Tour Story Imagery (no custom palettes) #4935

Merged
merged 9 commits into from
Jan 29, 2024
Prev Previous commit
Next Next commit
Custom palette issues
  • Loading branch information
christof-wittreich committed Jan 10, 2024
commit 374a0f9dd3614603ad4905dcab4991efcd2d3f50
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