MapMarkersField collects several locations in one field. Use it for delivery stops, branches, equipment positions or other sets of points. It enables marker collection mode automatically.
Basic usage
This example adds points through the map without a geocoder. To enable address search, use searchable() and configure your search provider and authenticated endpoints. Selecting a search result adds a marker to the collection.
State and database storage
Use a JSON column with an Eloquent array cast for stops. Each marker is a GeoJSON Point with a stable feature ID:
Coordinates are [longitude, latitude]. Existing collections hydrate through the form; setting a camera center alone does not add a marker. Marker mode requires structured storage, not storeFormat('string').
Adding, moving and removing markers
Clicking the map adds a point when selectOnMapClick() is enabled. Select a marker to drag it. Use manualCoordinates() for coordinate entry and geolocation() for optional device location after a permission request initiated by the user.
draggableMarkers(false) disables marker dragging. deletableFeatures(false) prevents feature removal; readOnly() or a disabled field blocks edits. Undo and redo apply to committed edits; drag previews do not become separate history entries.
Clustering and list layout
Clusters show counts and expand on click. clusterRadius() accepts 20–100 pixels; the maximum cluster zoom must be below maxZoom(). Unselected points use GPU-rendered circles, with one selected DOM drag target per map instance.
Feature lists grow naturally unless featureListMaxHeight() bounds their scroll area. This setting accepts 128–4096 pixels; null restores natural height.
Validation and custom actions
The server validates feature IDs, Point coordinates, allowed area policies and the configured feature-count limits. maxFeatures() can be configured up to the hard limit of 200 features. Labels and other admitted properties are validated independently of browser edits.
Use featureSchema() to edit custom marker data in a native Filament modal. featureActions() and afterFeatureAdded(), afterFeatureUpdated() and afterFeatureDeleted() connect accepted changes to your PHP code. See feature forms, actions and events for complete examples and persistence rules.
Last modified on October 16, 2026