--- url: /reference/items/StoreLocator/examples.md --- # Examples Both examples register the Mapbox components they use (`StoreLocator`, `MapboxMap`, `MapboxCluster`, `MapboxClusterItem`) independently — see [Usage](./#usage) for the recommended lazy registration — and add a small root component for the detail panel. The `StoreLocator` orchestrates a `MapboxMap` containing a `MapboxCluster` whose `MapboxClusterItem`s are the sidebar entries. Each example loads the [Mapbox GL stylesheet](/reference/items/MapboxMap/#installation) from a CDN and picks a Mapbox style through the `map-options` option. Replace the access token with your own [access token](https://docs.mapbox.com/help/getting-started/access-tokens/); the token used here is a public, restricted demo token. ## Basic store locator A `StoreLocator` wrapping a clustered map whose `MapboxCluster` holds a sidebar list of Paris `MapboxClusterItem`s. The cluster has **no** authored data: it derives a GeoJSON `FeatureCollection` from its registered items, and the orchestrator adds selection, viewport filtering and the detail drawer on top. Try it out: * **Pan or zoom the map** — the sidebar filters to the in-view stores and reorders them nearest-first. * **Click a store in the list** — the map flies there, the item is marked active, a popup opens and the detail drawer opens. * **Click a cluster** — the map zooms in and splits it; click an individual pin to select its store. The detail panel is the integrator's choice. Here it is a [`Dialog`](/reference/items/Dialog/) drawer, opened from the [`map-select`](./js-api#map-select) event through a small root component's `onStoreLocatorMapSelect` handler, which copies the selected item's `