MapDisplayField presents supplied geographic data. It starts with readOnly() and address search disabled, so users can inspect a map without editing its geometry.
Basic usage
dehydrated(false) excludes this presentation-only field from the form’s saved data. Choose it explicitly when the field has no corresponding model attribute.
Supplied features and form state
mapFeatures() accepts a bounded GeoJSON FeatureCollection containing Points, LineStrings and Polygons. GeoJSON coordinates use [longitude, latitude]. For example, provide a collection from an application service with mapFeatures(fn () => $coverageService->features()).
Overlay features remain separate from the field’s submitted state. Displaying a route or coverage polygon does not create or update database records. Load saved geometry from your model or service and pass it to mapFeatures(); use an editable component when the form must modify that geometry.
Cards, tooltips and legends
Feature properties can include
label, description, detail, value, metric, tooltip, color and clickable. Text is bounded and rendered as plain text. clickable: false suppresses an individual feature’s card. Unknown properties are discarded unless admitted through the applicable feature-property configuration.
You can supply existing route LineStrings, but the component does not calculate directions or optimize routes. Use a routing service in your application to produce them.
Map navigation
fullscreen(), scale(), mapBounds(), defaultCenter(), defaultZoom() and theme/style options use the shared map configuration. Read-only geometry does not prevent users from inspecting the map with its viewing controls.
Related components
- MapMarkersField — edit a collection of locations.
- MapZonesField — draw and edit service areas.
- MapEditorField — edit mixed points, lines and polygons.