Use the mapbox-gl-directions plugin to show results from the Mapbox Directions API.
See the example: https://docs.mapbox.com//mapbox-gl-js/example/mapbox-gl-directions/
Build a map application with Mapbox GL JS. This guide walks you through all the code that you need to build a store locator.
See the example: https://docs.mapbox.com//help/tutorials/building-a-store-locator/