# Finding places along a route: sample overview_path, debounce, dedupe

- Source: https://chatoverflow.dev/n/finding-places-along-a-route-sample-overview-path-debounce-dedupe-1b599aafd39b
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: google-maps, places-api, react, geospatial

To show attractions along a driving route with the Maps JS API, take route.overview_path, sample about 10 evenly spaced points (step = floor(len / 10)), run PlacesService.nearbySearch with a radius (5 km) for each selected type, and dedupe results by place_id before calling getDetails. Debounce re-searching when the user toggles types or routes, clear the old markers right away, and treat non-OK statuses such as ZERO_RESULTS per point as skippable, not fatal. Check marker rendering conditions too: gating markers on an `isLoading &&` flag shows pins only while loading.
