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-3087 AERONET Layers Implementation #4987

Merged
merged 28 commits into from
May 31, 2024

Conversation

christof-wittreich
Copy link
Contributor

@christof-wittreich christof-wittreich commented Feb 14, 2024

Description

This adds four new layers from AERONET in the form of special vector layers. These vector layers render as vector points, but are colored by a continuous color palette based on each vector point's value. This is a unique type of layer specific to only the AERONET layers, and as such the implementation is very custom-fit to it.

How To Test

  1. git checkout wv-3014-aeronet-aod500nm
  2. npm ci
  3. npm run build
  4. npm run watch
  5. Open the 'Add Layers' modal and verify that AERONET layers can be searched for, seen in the Aerosol Optical Depth category, and are shown in the sidebar via the AERONET source.
  6. Add either of the AOD AERONET layers and verify that the color palette is applied correctly to the vector points. Select a custom color palette and verify that the vector points correctly update to the custom palette. Do the same with either of the Angstrom Exponent AERONET layers as well.
  7. Verify that toggling on and off the Inactive Sites vector points via the layer settings works properly and hides the inactive gray vector points correctly.
  8. Add either of the near-realtime AERONET layers and verify that the timeline changes to be hourly skips instead of daily, and that transitioning across time correctly updates which vector points have an active value.
  9. Verify that clicking on any of the vector points from any zoom level brings up a vector dialog, and that it contains the correct information and links for that site.
  10. Verify that mousing-over a vector point correctly highlights the color palette on the side panel at the correct color, or the Inactive Sites vector color square on the side panel for inactive sites.
  11. Briefly verify that other vector layers are not broken by the changes implemented here.

@christof-wittreich christof-wittreich changed the title Layer framework WV-3087 Aeronet Layers Implementation May 1, 2024
@christof-wittreich christof-wittreich changed the title WV-3087 Aeronet Layers Implementation WV-3087 AERONET Layers Implementation May 1, 2024
@christof-wittreich christof-wittreich marked this pull request as ready for review May 1, 2024 21:09
@christof-wittreich christof-wittreich self-assigned this May 1, 2024
@minniewong minniewong modified the milestones: v4.35.0, v4.36.0 May 3, 2024
@PatchesMaps
Copy link
Contributor

The application crashes as soon as I add an AERONET layer

const date2 = new Date(date.toString());
date2.setHours(date.getHours() + 1);
const urlParameters = `?year=${date.getUTCFullYear()}&month=${date.getUTCMonth() + 1}&day=${date.getUTCDate()}&year2=${date2.getUTCFullYear()}&month2=${date2.getUTCMonth() + 1}&day2=${date2.getUTCDate()}${isSubdaily ? `&hour=${date.getUTCHours()}&hour2=${date2.getUTCHours()}` : ''}&AOD15=1&AVG=${avg}&if_no_html=1`;
const res = await fetch(source.url + urlParameters);
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer using a template literal in this situation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@PatchesMaps line 551 here (const urlParameters = ...) is already formatted as a template literal. Did you have feedback on how I wrote the template literal, or was your comment intended for a different line?

Copy link
Contributor

Choose a reason for hiding this comment

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

It was intended for line 552: ${source.url}${urlParameters} is what I had in mind.

web/js/map/layerbuilder.js Show resolved Hide resolved
values = state.palettes.rendered[def.id].maps[1].entries.values;
}

const requestDate = util.toISOStringSeconds(util.roundTimeOneMinute(date)).slice(0, 10);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we rounding the time to the minute?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do the same process for ttiler and xyz layers (as can be seen in this same file), so it was included to match those. I don't think it's needed though, and the other vector layers do not use it, so I'll remove this.

@minniewong minniewong removed the request for review from ryanweiler92 May 3, 2024 19:35
@minniewong minniewong modified the milestones: v4.39.0, v4.40.0 May 30, 2024
@christof-wittreich christof-wittreich merged commit c57d780 into develop May 31, 2024
2 of 4 checks passed
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.

None yet

3 participants