Skip to content

Conversation

@lucaswoj
Copy link
Contributor

@lucaswoj lucaswoj commented Dec 2, 2025

Related to #6800 (comment)

LngLatBounds#intersects wasn't treating coincident edges as an intersection. I've updated the behavior so that bounds which touch along an edge or corner are now considered intersecting. This is more intuitive and consistent with how most spatial libraries handle intersection checks.

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.40%. Comparing base (cf0f690) to head (40cfc6b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/geo/lng_lat_bounds.ts 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6802      +/-   ##
==========================================
- Coverage   92.42%   92.40%   -0.02%     
==========================================
  Files         288      288              
  Lines       23809    23807       -2     
  Branches     5057     5056       -1     
==========================================
- Hits        22006    22000       -6     
- Misses       1803     1807       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lucaswoj lucaswoj requested a review from HarelM December 2, 2025 19:17
@lucaswoj lucaswoj marked this pull request as ready for review December 2, 2025 19:17
@lucaswoj lucaswoj changed the title Add LngLatBounds 'entire worlds tile should return true' test Make LngLatBounds#intersects return true when bounds touch along an edge or at a corner Dec 2, 2025
@HarelM
Copy link
Collaborator

HarelM commented Dec 2, 2025

Thanks for looking into this. I've added a comment about one of the calculations.
Looks good otherwise.

@HarelM HarelM enabled auto-merge (squash) December 2, 2025 21:39
@HarelM HarelM merged commit 2cf5d85 into maplibre:main Dec 2, 2025
24 checks passed
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