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

Legend 2: Create legend components #2443

Merged

Conversation

yvonnesjy
Copy link
Collaborator

No description provided.

@yvonnesjy yvonnesjy requested review from ianguerin and robyngit June 11, 2024 02:49
src/js/models/maps/assets/MapAsset.js Outdated Show resolved Hide resolved
src/js/views/maps/legend/LegendContainerView.js Outdated Show resolved Hide resolved
src/js/views/maps/legend/LegendContainerView.js Outdated Show resolved Hide resolved
@yvonnesjy yvonnesjy linked an issue Jun 13, 2024 that may be closed by this pull request
new AssetColorPalette(
_.extend(
assetConfig.colorPalette,
_.pick(assetConfig, "label"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand, here we pass on the layer's label to overwrite the name of the property that is displayed in the legend. Why are we doing this? We may want to display the name of the property that is actually shown in the legend, or use the label that is configured in the colorPalette config.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yea I saw that palette's label is currently not used so I assumed it's safe to override. But I just noticed that it's mentioned in ColorPaletteConfig so other portals might have it configured. I updated it to use the layer label only if a label is not set in the color palette config.

src/js/models/maps/Map.js Outdated Show resolved Hide resolved
@yvonnesjy yvonnesjy force-pushed the feature-1784-create-legend-components branch from 95f4e04 to 901e4b5 Compare June 17, 2024 21:02
@yvonnesjy yvonnesjy force-pushed the feature-1784-create-legend-components branch from 2c14302 to 43bdf9f Compare June 17, 2024 21:47
@yvonnesjy yvonnesjy requested a review from robyngit June 17, 2024 21:49
@robyngit robyngit merged commit b57608a into NCEAS:develop Jun 18, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show a legend for data layers that require one in the Cesium View
3 participants