The click on the map is too precise; I click on a google map restaurant for example but…
- User
The click on the map is too precise; I click on a google map restaurant for example but it find me the route instead. Can you make it find me the correct place instead of a road?
- Assistant
Examining the Map component's click handling to prioritize place markers over roads.
[tool: read_file — Tool use: read_file • Read file: src/components/Map.tsx]
[tool: codebase_search — Tool use: codebase_search • Searched codebase "How are map clicks handled to select places or markers?" • 11 results]
The click handler uses
nearbySearchwith a 50m radius and may return routes. Updating it to prioritize establishments and exclude routes:[tool: search_replace — Tool use: search_replace • Edit file: src/components/Map.tsx]
[tool: read_lints — Tool use: read_lints • Read lints for 1 file]
Fixing the type error:
typemust be a single string, not an array.[tool: search_replace — Tool use: search_replace • Edit file: src/components/Map.tsx]
[tool: read_lints — Tool use: read_lints • Read lints for 1 file]
Updated the click handler to prioritize places over routes:
- Increased search radius from 50m to 100m
- Added filtering to exclude route types (
route,street_address,premise,subpremise) - Distance calculation to select the closest valid place to the click
When you click near a restaurant marker, it will:
- Search within 100 meters
- Filter out routes and addresses
- Select the closest valid establishment
This should fix the issue where clicking on restaurants was selecting routes instead.