Skip to content

Conversation

@ahennr
Copy link
Member

@ahennr ahennr commented Dec 15, 2025

This PR adds WMTS (Web Map Tile Service) support to the useCoordinateInfo hook and refactors feature fetching logic for better performance and maintainability.

Key Changes:

  • WMTS Support: Added WMTS layer handling with feature info URL generation
  • Performance: Implemented useMemo hooks to memoize map properties and layer filtering
  • Request Management: Added AbortController support to prevent memory leaks and race conditions

Plz review @terrestris/devs

@ahennr ahennr force-pushed the feat/coordinate-info-abort-controller branch 2 times, most recently from 90bf754 to 2b932db Compare January 9, 2026 16:30
@ahennr ahennr force-pushed the feat/coordinate-info-abort-controller branch from 2b932db to 2ae3661 Compare January 23, 2026 16:45
@ahennr ahennr force-pushed the feat/coordinate-info-abort-controller branch from 2ae3661 to b68dcc7 Compare February 11, 2026 12:34
@ahennr ahennr changed the title feat: adds abort controller to useCoordinateInfo feat(useCoordinateInfo): support WMTS layer type and abort controllers Feb 11, 2026
@ahennr ahennr changed the title feat(useCoordinateInfo): support WMTS layer type and abort controllers Refactor useCoordinateInfo Hook: Add WMTS Support, Optimize Layer Fetching, and Improve Performance Feb 11, 2026
@ahennr ahennr marked this pull request as ready for review February 11, 2026 13:40
Copy link
Member

@KaiVolland KaiVolland left a 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.

Comment on lines 6 to +8
import _isNil from 'lodash/isNil';
import _isString from 'lodash/isString';
import _uniqueId from 'lodash/uniqueId';
Copy link
Member

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]);
Copy link
Member

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.

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