Repository navigation
feat(map): list only the places in the visible map area - #363
Merged
Merged
Conversation
…view A search that leaves one place fitted a zero-size box and zoomed to level 19, where the basemap is blank. The fit is now capped (16 for one place, 15 for several) and the go-to-place zoom shares one constant. The map used to open on the whole world with grey bands above and below the tiles. It now keeps the basemap covering the viewport with a minimum zoom, reopens where the visitor last left it (localStorage, guarded), and opens on a signed-in visitor's saved home when nothing else chose a view. An explicit lat/lng/zoom, place, search or filter in the URL still wins, and nothing asks for geolocation on load. Closes #350 Closes #353
…h this area prompt The results list was driven by filters only, so panning to Lagos still listed Heathrow first. An 'Only places in this view' switch (on by default from zoom 8) limits the list to the area the map showed, and the header now reads 'N places in this view' or 'N places total'. The list is pinned to one area: moving the map shows a 'Search this area' button instead of re-sorting rows under the visitor's cursor mid-scroll. Nearest-first still applies when a location is set. The map now reports its visible bounds; they are kept out of the URL and storage. Works in the desktop panel and the mobile sheet, which share one MapPanel. Closes #351
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
2 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this changes
#351: the results list was driven by filters only, so panning to Lagos still listed Heathrow first.
MapPanel, so both get it.inBounds,filterByBounds,sameBounds,wantsInView) is infilters.tswith its own tests, including a view that crosses the antimeridian.Type of change
Testing
npm run typecheck,npm run lint,npm run test:unitandprettier --check srcpass.filters.test.ts: 10 tests for the bounds logic.places-map.test.tsx: 7 tests that drive viewport changes through the map callback: total while zoomed out, in view once zoomed in, no reshuffle on a pan plus the prompt, the prompt re-lists the new area, the switch off, filters still apply inside the view, bounds stay out of the URL.Not covered
Closes #351