Skip to main content
← Back to Table of Contents

Shared map settings

See shared map configuration for Mapbox/MapLibre rendering, address-search endpoints, GPS, controls and appearance. Collection editing has separate guides for markers, zones and mixed geometry.

Summary

Select one location through address search or a point on the map. Store a structured coordinate/address array or a formatted address string. Rendering supports Mapbox and MapLibre; address lookup uses the configured geocoder. The default Mapbox renderer requires a Mapbox access token in config('filament-flex-fields.mapbox.access_token') or per-field via mapboxToken(). mapProvider('maplibre') does not require that token for rendering; search remains a separate provider. Server-side address search and reverse geocoding use automatically registered, authenticated endpoints shared with Address Autocomplete. See shared endpoint configuration for the route prefix and authentication guard.

Basic usage

Structured Location (Coordinates + Address)

Formatted String Output


State & validation

Canonical internal keys

lat, lng, street, city, region, postcode, country, country_name, place_name

Stored value

Validation rules (built-in)


Configuration API

All methods accept Closure unless noted.
POI note: searchTypes([MapboxSearchType::Poi]) returns general Mapbox points of interest — not restaurant/cafe category filters (Geocoding v5 limitation).

FlexField / Flex Forms schema config

Shared with AddressAutocompleteField via AppliesGeocodingStudioConfig / GeocodingSearchScope:

Real-world examples

Pickup Point (POI only)

City Selector


Playground

/admin/flex-fields/map-picker See Playground for setup.

Building numbers and map gestures

requireStreetNumber() removes street-only results and requires a numbered building address. This uses provider number metadata, applies to reverse lookup, and is enforced again on the server. It does not verify an apartment or prove an address is deliverable. The current geocoder uses Mapbox V5; Mapbox V6 supports secondary/unit addresses in covered regions, which is a separate integration. Use scrollZoom()->cooperativeGestures(false) to enable direct wheel/trackpad zoom. Native SDK touch gestures handle pinch/rotation. Keeping cooperative gestures on requires the SDK modifier/multiple-finger gesture to protect normal page scroll.

Specialized map components

Last modified on October 16, 2026