Skip to content

fix MlWmsLoader reinitialization on prop change bug#255

Merged
cioddi merged 4 commits intomainfrom
fix/mlwmsloader-reinitialization
Feb 4, 2026
Merged

fix MlWmsLoader reinitialization on prop change bug#255
cioddi merged 4 commits intomainfrom
fix/mlwmsloader-reinitialization

Conversation

@cioddi
Copy link
Member

@cioddi cioddi commented Feb 4, 2026

No description provided.

@cioddi cioddi requested a review from Copilot February 4, 2026 13:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a reinitialization bug in the MlWmsLoader component that occurred when props changed. The fix refactors how default props are merged with user-provided props, moving from object spreading to useMemo hooks for stable references. Additionally, it improves CRS/SRS handling in GetFeatureInfo requests and removes an unused utility function.

Changes:

  • Refactored prop merging to use useMemo for URL parameter objects to prevent unnecessary re-renders
  • Enhanced GetFeatureInfo bbox calculation to support EPSG:4326/CRS:84 coordinate systems
  • Removed unused LngLat import and lngLatToMeters utility function

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/react-maplibre/src/components/MlWmsLoader/MlWmsLoader.tsx Refactored prop handling with useMemo, improved CRS handling in GetFeatureInfo, removed unused utility function
packages/react-maplibre/src/components/MlWmsLoader/MlWmsLoader.stories.tsx Added new story demonstrating custom feature info handling with sidebar display

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cioddi cioddi merged commit 0bd85e5 into main Feb 4, 2026
7 of 13 checks passed
@cioddi cioddi deleted the fix/mlwmsloader-reinitialization branch February 4, 2026 13:57
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.

1 participant