Leaflet bug - Mapbox tiles did not load in certain scenarios #1814
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request type
Description
This PR addresses critical issues with the Maps widget's Leaflet-based providers (Mapbox, OpenStreet, and Here Maps) where auto-zoom functionality was firing too early before markers were rendered, and map tiles were not loading properly.
Root cause: The older Leaflet version had compatibility issues with certain tile providers. Additionally, the auto-zoom logic was calculating bounds and setting zoom levels before map markers were fully rendered, resulting in incorrect zoom positioning.
Changes made:
Technical improvements:
Quality assurance:
✅ All 15 tests pass
✅ ESLint validation passes
✅ No breaking changes to existing APIs
✅ Google Maps functionality unchanged
✅ Backward compatibility maintained
What should be covered while testing?
Test scenarios:
Mapbox provider: Verify tiles load correctly and auto-zoom works with proper timing
OpenStreet provider: Test auto-zoom behavior with multiple markers at varying distances
Here Maps provider: Ensure consistent zoom levels and tile loading
Edge cases: Test with markers very close together (should respect maxZoom: 15 limit)
Performance: Verify the 100ms delay doesn't negatively impact user experience
Expected behavior:
Map tiles should load immediately without blank/missing areas
Auto-zoom should trigger after markers are visible and position the map correctly
Zoom level should be reasonable even when markers are clustered closely
No regression in manual zoom or other existing functionality
Checklist review:
❌ JIRA story: No JIRA ticket
❌ Version bump: Maybe not required - bug fix maintains API compatibility
❌ Related PRs: None in other repositories
❌ Documentation: No XML changes or new features requiring docs
✅ Bug fix: Detailed testing instructions provided above