-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor useCoordinateInfo Hook: Add WMTS Support, Optimize Layer Fetching, and Improve Performance #1001
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
base: main
Are you sure you want to change the base?
Conversation
90bf754 to
2b932db
Compare
2b932db to
2ae3661
Compare
2ae3661 to
b68dcc7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some remarks. But none of them is blocking.
Also the PR contains some german code docs you might want to translate.
| import _isNil from 'lodash/isNil'; | ||
| import _isString from 'lodash/isString'; | ||
| import _uniqueId from 'lodash/uniqueId'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to get rid of external dependencies you might want to have look at:
https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore
| }); | ||
|
|
||
| return relevantLayers; | ||
| }, [map, wfsMapLayers, wmtsMapLayers, wmsMapLayers]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iterating over all layers (three times) for each variable seems inefficent to me. Maybe there is a way to do all this with one or at least less iterations.
Co-authored-by: Kai Volland <kaivolland@yahoo.de>
This PR adds WMTS (Web Map Tile Service) support to the
useCoordinateInfohook and refactors feature fetching logic for better performance and maintainability.Key Changes:
useMemohooks to memoize map properties and layer filteringAbortControllersupport to prevent memory leaks and race conditionsPlz review @terrestris/devs