Selection and storage modes
The specialized geographic components inherit the map renderer and shared controls fromMapPickerField. Their defaults select the relevant mode:
Geometry collections require structured storage and an Eloquent
array cast for a JSON column. Changing a point/address field into a collection requires an application data migration. mapFeatures() overlays stay separate from submitted form state. MapDisplayField presents supplied layers; CountryMapField stores ISO country codes instead of GeoJSON.
Rendering and search are independent
mapboxToken(). MapLibre uses OpenFreeMap styles by default and needs no Mapbox token for rendering. Address search still needs a configured geocoder. A custom server provider implements the existing GeocodingProviderContract; custom browser proxy endpoints must return the same feature/response contract used by the shared address adapter. Selecting MapLibre does not automatically provide an alternative search service.
Resource URLs are pinned: Mapbox GL JS 3.9.0 and MapLibre GL JS 6.11.2. mapAssets() supports self-hosted SDK/CSS; mapWorkerUrl() supports the chosen renderer’s worker configuration. Developer-supplied SDKs must expose the compatible Map, Marker, Popup, LngLatBounds and ScaleControl API. Use one SDK version per provider per document. Tile/style licensing, tokens, attribution and CSP remain the host’s provider configuration responsibilities. The component preserves renderer attribution.
Shared address-search endpoints
Withmapbox.use_server_proxy enabled (the default), Map Picker and Address
Autocomplete use the same two application endpoints:
FLEX registers these endpoints automatically through one shared component
definition. Multiple maps or address fields do not register extra copies.
Address Autocomplete does not load a map SDK to share these endpoints.
Requests use your configured server geocoder, with input validation, caching and
rate limiting. The default
web and auth middleware require an authenticated
session and protect POST requests with Laravel’s CSRF middleware.
Configure the prefix or your application’s authentication guard before routes
are cached:
config/filament-flex-fields.php
auth for the default guard, or a guard configured in your application.
The proxy requires authentication; removing it from this middleware list is
rejected. Rebuild Laravel’s route cache after changing the prefix or middleware.
Map tiles and renderer resources continue to use your chosen map provider;
these two endpoints serve address search and reverse geocoding.
Map configuration reference
Most setters accept a Closure evaluated by Filament when the snapshot is built.multipleMarkers() and drawZones() accept booleans. Numeric and list bounds fail explicitly when the snapshot is resolved.
Coordinate order is deliberately explicit: the legacy
defaultCenter() is latitude-first; GeoJSON, proximity and radius centers are longitude-first. GPS is optional, requires browser permission/secure context and is never requested during component initialization. A later map/search/manual selection or external state update invalidates an earlier pending GPS/reverse-geocoding intent.
Shared search and editable addresses
Map Picker and Address Autocomplete share search scope, limits and optional editable address details. See AddressAutocompleteField for the API and a complete example.Runtime ownership and assets
Map SDK objects, markers, observers, request leases and undo snapshots are kept outside Alpine’s reactive graph under the stable component root. Destroy disconnects observers, disposes requests, removes map/marker/popup objects and cancels scheduled work. Resize uses one coalesced frame and ignores unchanged/zero dimensions. SDK/CSS loading is single-flight per provider/resource identity; failed owned nodes are cleaned and loading can be retried. Only near-viewport map instances initialize. The plain CountryMap SVG view needs neither SDK nor geocoding.map-picker, address-autocomplete, country-map-field request their own assets/dependencies through the existing asset manager. FlexTextInput, Select, teleported menu and the shared checkbox indicator are dependencies deduplicated across consumers. No page-wide registration of every package component is introduced.
Appearance
MapPickerField::make('location')->rounding('xl') uses the same md, lg, xl, native or full radius configuration/default as the other package fields. Map surfaces and zone cards inherit it; floating toolbars always use fully rounded capsules. Map search uses the shared FlexTextInput styling through size() and variant().
Feature cards and coverage legends
featurePopups(false) disables cards. They are enabled by default for marker/overlay selection. showLegend()->legendTitle('Coverage zones')->legendDescription('Delivery capacity') displays a card on the map using state features in collection modes or configured overlays otherwise. Point/zone selection from the card uses the same selection controller as the map.
Feature properties admit bounded plain text: label, description, detail, value, metric, tooltip, plus hexadecimal color and boolean clickable. Cards display title, description, detail and emphasized value; legend rows display label and optional metric. These fields never execute HTML. Unrecognized properties are discarded. Map controls use only the supplied artwork in resources/svg/maps, rendered through the bounded MapIcon catalog. Point markers are plain circles, with no pin SVG. One card, one hover tooltip and at most one selected DOM marker belong to each map instance. The GPU point filter hides that selected marker without removing it from cluster data.
Floating controls for geographic and country maps share the lazy location-controls CSS dependency. Their button/icon dimensions and capsule surface are identical, with blur and inset edge highlights. No SDK is loaded for the SVG country map.
Feature lists, forms and events
Marker and zone lists grow naturally. UsefeatureListMaxHeight(320) to bound a long list; the accepted range is 128–4096 pixels, and null restores natural height.
Collection components also support custom feature forms, native actions and PHP events. Those settings do not create separate database records automatically.