mapbox-store-locator-patterns

Build Mapbox store locators with markers, filtering, and distance calculations.

Updated May 18, 2026
One-click install
npx skills add https://github.com/RizkLee/HNNU-Campus-Guide --skill mapbox-store-locator-patterns-rizklee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mapbox-store-locator-patterns
Source: https://github.com/RizkLee/HNNU-Campus-Guide/tree/main/.agents/skills/mapbox-store-locator-patterns
Command: npx skills add https://github.com/RizkLee/HNNU-Campus-Guide --skill mapbox-store-locator-patterns-rizklee

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enables developers to rapidly build map-based location search experiences (store/restaurant locate, etc.) with consistent patterns for map rendering, filtering, distance calculations, and interactive lists.

Core Features & Use Cases

  • Map display of locations using markers or symbol layers
  • Filtering and searching by name, category, or distance
  • Distance calculations using Turf and client geolocation
  • Interactive sidebar listing synchronized with map markers and popups
  • Optional directions integration to selected locations

Quick Start

Use this Skill to scaffold a Mapbox-based locator by providing a GeoJSON dataset of places, a Mapbox access token, and a UI that filters, sorts by distance, and shows routes.

Frequently Asked Questions about mapbox-store-locator-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a store locator with Mapbox GL JS and Turf?

To build a store locator, use Mapbox GL JS v3 for rendering markers and Turf for distance calculations. Structure your location data in GeoJSON format to enable filtering, ranking, and interactive list synchronization.

What is the best way to filter map markers by category and distance in a Mapbox locator?

Filtering map markers by category and distance requires a consistent GeoJSON properties structure. The locator uses Turf to calculate distances from client geolocation, enabling dynamic filtering and sorting of the interactive sidebar list.

How do I handle marker strategies for a Mapbox locator with hundreds of locations?

For a Mapbox locator with hundreds of locations, scale marker strategies by switching from individual markers to symbol layers. This approach maintains performance while interacting with popups and the synchronized sidebar list.

Does this Mapbox locator pattern support adding directions to selected locations?

Yes, the Mapbox locator pattern supports optional directions integration. After filtering locations and calculating distances with Turf, you can add routing directions directly to the selected locations within your map interface.

Do I need GeoJSON to create a Mapbox store locator with distance calculations?

Yes, GeoJSON is required to create a Mapbox store locator. The locator relies on a GeoJSON dataset with a consistent properties structure to perform distance calculations with Turf and enable location filtering.

Why use Turf for distance calculations in a Mapbox store locator instead of native APIs?

Using Turf for distance calculations in a Mapbox store locator ensures accurate client-side geolocation ranking. It directly processes GeoJSON coordinates to sort locations and synchronize the interactive map list.