Selecting roads on map with Overpass API

Example of a road selected on map
For a recent project at one of my courses, we had a requirement to highlight a road segment on a map when user clicks on it.
In a search for a ready-to-use database or API with road coordinates, I’ve found Overpass.
It’s a part of an OpenStreetMap project that provides OSM map data over API, and has a feature to get roads around given point, which is exactly what was needed.
You can try the demo right away or proceed reading the article on implementation details.

Read more