> ## Documentation Index
> Fetch the complete documentation index at: https://flex-fields.bjanczak.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Examples target Filament 5. Verify optional dependencies before configuring integrations.
> Upload transfer completion, permanent storage and record acceptance are separate milestones. Native and Spatie image conversions retain the original.

# MapDisplayField

> Present supplied GeoJSON points, lines and coverage areas with configurable cards and legends.

<video autoPlay muted loop playsInline controls preload="metadata" src="https://mintcdn.com/flex-fields/cY70dYD2SDr8chb8/art/previews/map-display-motion.mp4?fit=max&auto=format&n=cY70dYD2SDr8chb8&q=85&s=ff498bfe759183b090198a44c26ac365" poster="/art/previews/map-display.webp" width="1920" height="1080" aria-label="MapDisplayField — FLEX Fields demonstration">
  [Watch the MapDisplayField demonstration (MP4).](https://flex-fields.bjanczak.com/art/previews/map-display-motion.mp4)
</video>

`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

```php theme={"theme":{"light":"github-light","dark":"github-dark"}}
use Bjanczak\FilamentFlexFields\Filament\Forms\Components\MapDisplayField;

MapDisplayField::make('coverage_overview')
    ->label('Service coverage')
    ->mapProvider('maplibre')
    ->mapFeatures([
        'type' => 'FeatureCollection',
        'features' => [
            [
                'type' => 'Feature',
                'id' => 'office',
                'geometry' => [
                    'type' => 'Point',
                    'coordinates' => [21.0122, 52.2297],
                ],
                'properties' => [
                    'label' => 'Main office',
                    'description' => 'Customer collection point',
                    'color' => '#3b82f6',
                ],
            ],
        ],
    ])
    ->showLegend()
    ->legendTitle('Service locations')
    ->legendDescription('Select a location to inspect it')
    ->fitFeatures()
    ->fullscreen()
    ->mapHeight(440)
    ->dehydrated(false);
```

`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

| Configuration | Result |
| - | - |
| `showLegend()` | Display a selectable feature legend. |
| `legendTitle()`, `legendDescription()` | Set your own legend text. |
| `featurePopups(false)` | Hide click cards while retaining the legend. |
| `featureTooltips(false)` | Hide hover/focus labels. |
| `fitFeatures()` | Fit the initial camera to supplied features. |

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](https://flex-fields.bjanczak.com/docs/location-v4.md). Read-only geometry does not prevent users from inspecting the map with its viewing controls.

## Related components

* [MapMarkersField](https://flex-fields.bjanczak.com/docs/map-markers.md) — edit a collection of locations.
* [MapZonesField](https://flex-fields.bjanczak.com/docs/map-zones.md) — draw and edit service areas.
* [MapEditorField](https://flex-fields.bjanczak.com/docs/map-editor.md) — edit mixed points, lines and polygons.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.