Skip to content

feat: Separate Marker Layer from RasterTimeSeries #1595

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

Merged
merged 4 commits into from
Apr 10, 2025
Merged

Conversation

hanbyul-here
Copy link
Collaborator

@hanbyul-here hanbyul-here commented Apr 8, 2025

Related Ticket: #1545

Description of Changes

Separate the Marker Layer from the RasterTimeSeries. For more context: Raster Timeseries shows markers for the dataset that have minimum zoom set up higher than the current Zoom to indicate to users where the data is. (ex. NightLight data: ). This PR separates these Marker Layers so that RatserTimeSeries can eventually consist of RasterPaintLayer + MarkerLayer. I believe the Marker Layer is uncoupled enough to be used outside of the RasterTimeSeries if needed.

  • Move useRequestStatus (renamed from useLayerStatus) to the hooks file
  • did some lint cleaning 🧹

Validation / Testing

  • RasterTimeseries data should work as before. (Whether it has marker layers or not.)

@hanbyul-here hanbyul-here changed the title refactor: Separate Marker Layer from RasterTimeSeries feature: Separate Marker Layer from RasterTimeSeries Apr 8, 2025
@hanbyul-here hanbyul-here changed the title feature: Separate Marker Layer from RasterTimeSeries feat: Separate Marker Layer from RasterTimeSeries Apr 8, 2025
Copy link

netlify bot commented Apr 8, 2025

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit 7c24add
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/67f4e9ff3674e90008c78b5d
😎 Deploy Preview https://deploy-preview-1595--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hanbyul-here hanbyul-here requested a review from AliceR April 9, 2025 01:23
@hanbyul-here hanbyul-here marked this pull request as ready for review April 9, 2025 01:23
@hanbyul-here hanbyul-here requested a review from dzole0311 April 9, 2025 01:31
Copy link
Member

@AliceR AliceR left a comment

Choose a reason for hiding this comment

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

I appreciate the clear separation of concerns between these two layers - it's a thoughtful architectural decision that improves maintainability.
The comment below is just some food for thought regarding the decision point for rendering...

I noticed a gap where none of the layers are rendering... is that intentional? Since you set maxzoom: minZoom, in the point layer, I wouldn't expect a gap.

Comment on lines +504 to +513
return (
points && (
<PointsLayer
id={id}
points={points}
zoomExtent={zoomExtent}
onPointsClick={onPointsClick}
/>
)
);
Copy link
Member

Choose a reason for hiding this comment

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

Can you explain why the points are returned from the raster-timeseries layer?

I may be missing some context, but I think the decision of whether to display points or raster based on zoom level would make more sense at a higher architectural level, before rendering either.
It seems confusing to have one layer returned from another, and leaves the responsibility unclear. A cleaner approach would be to have a decision layer that selects the appropriate visualization method (points or raster) based on zoom level, then routes to either a dedicated points layer or raster layer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The points are there to indicate where the raster datasets are. When a user is on a lower zoom than the dataset's minimum zoom, the points will show up. From this context that points data is derived from raster timeseries data, I think it makes sense that points are accompanied by raster paint layer, and raster-timeseries is that decision layer to render both of those layers. It would make sense to make the minZoom/maxZoom more explicit as you suggested, and I think it would be on JSX level change (in pseudo code : points && map.minZoom < ... && <Points ... than having one more layer on top of raster timeseries. Maybe I am looking at this code too long that I am missing something? In any case, let's make it better little by little 🔨

@hanbyul-here
Copy link
Collaborator Author

@AliceR that gap has been a mystery for me too!! I shamefully never tired to figure out why that is happening :[

@hanbyul-here hanbyul-here merged commit 63dbead into main Apr 10, 2025
16 checks passed
@hanbyul-here hanbyul-here deleted the 1545-marker-layer branch April 10, 2025 06:04
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.

2 participants