In my day job we recently completed a project to field locate our water utility assets using a high-accuracy GPS unit. Now that this data is online and accessible in our web maps, our field crews requested a method to locate these assets again using GPS if need be, for instance if there is a foot of snow on the ground.
A primary focus of my day job is managing utility datasets for a small municipality. I am currently in the process of taking a simple database of lines and points and turning it into a true utility network. One of the benefits of having this new seamless database is to perform network traces. This is possible using a variety of desktop and server tools including geometric networks in ArcGIS Desktop, the ArcGIS Utility Network Management extension for ArcGIS Server/Enterprise, pgRouting, and via various QGIS plugins. However, the utility field crews and managers only have access to our web maps, so I wondered if I could program a Mapbox GL JS plugin to do some simple network tracing directly in the browser. Fortunately in my case the entire database is less than 3MB, so all the data can be loaded into the browser via GeoJSON. This data can then be visualized and analyzed using client-side libraries, in this instance Mapbox GL and Turf JS.
This simple, responsive store locator is based on the original Mapbox JS example, tweaked to use Leaflet 1.0 and custom icons. The sidebar uses a jQuery filter function (thanks jsfiddle). The nearest store function uses TurfJS, based loosely on this example. The production version uses surge.sh for deployment. This app was originnally created in collaboration with Nick Kroncke for Shagbark.