Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to search on map #107

Merged
merged 2 commits into from
Nov 15, 2024
Merged

Add ability to search on map #107

merged 2 commits into from
Nov 15, 2024

Conversation

jdudley1123
Copy link
Member

@jdudley1123 jdudley1123 commented Nov 14, 2024

Context

The user should be able to search for locations on the map so that they can quickly navigate to places that matter to them.

To do this we need a geocoder, which translates a natural language location like 'Barnet' or 'St Paul's Cathedral' into coordinates. Maptiler provides a geocoder which we can use for this.

Trello: https://trello.com/c/ng2eT8cY/112-allow-user-to-search-for-locations-on-the-map

Changes in this PR

This PR adds Maptiler's standard search control which uses their geocoder. All the behaviour and styling is handled by Maptiler.

Search is restricted to the UK. We could restrict further to roughly Airtext's coverage, but that requires more complex bounding boxes.

Screenshots of UI changes

Before

image

After

image (note that I've removed the other controls for this screenshot as they won't be in the final product, but are present in our current development version)

.maptilerGeocoding({
apiKey: this.settings.maptilerApiKey,
country: ["GB"],
proximity: [-0.116773, 51.510357], // Big Ben, lng lat
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

This will allow us to use it in other methods.
This uses Maptiler's Geocoding control, and all the behaviour and styling is handled by Maptiler.

Search is restricted to the UK. We could restrict further to roughly Airtext's coverage, but that requires more complex bounding boxes. Instead I've used the proximity setting to make it prefer results that are near London.
@jdudley1123 jdudley1123 merged commit 4937404 into develop Nov 15, 2024
2 checks passed
@jdudley1123 jdudley1123 deleted the search-on-map branch November 15, 2024 11:34
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