Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/diegobas/filament-drawable-map/llms.txt

Use this file to discover all available pages before exploring further.

Filament Drawable Map is a FilamentPHP v3 plugin that brings interactive Google Maps polygon fields directly into your Filament admin panel. Built for Laravel developers who need to define, capture, and display geographic zones — such as service areas, delivery regions, or coverage boundaries — it provides two ready-to-use form components that handle all the map rendering and coordinate serialization for you.

Components

The package ships two form field components that cover the full create-read-update workflow for polygon data. DrawableMap is a fully interactive field that lets users draw a polygon directly on a Google Map. Users hold Ctrl and click to place vertices, double-click an existing vertex to remove it, and click a Clear button at the top of the map to start over. The final polygon is automatically serialized as a JSON array of {lat, lng} coordinate objects and stored in your model. ViewableMap is a read-only display field that renders one or more stored polygons on a Google Map. It is ideal for detail and view pages where you want to show a zone without allowing edits. It supports multiple polygons via the polygons() method and optional title overlays via titles(). Both components share a common trait, InteractsWithMap, which provides the location(), zoom(), and clearButtonLabel() configuration methods.

Installation

Install the package via Composer, publish the config file, and add your Google Maps API key.

Quickstart

Add a working DrawableMap field to a Filament resource form in minutes.

Requirements

Before installing Filament Drawable Map, make sure your project meets the following requirements:
  • PHP ^8.0
  • FilamentPHP ^3.0
  • Google Maps API key with the Maps JavaScript API enabled
The package also pulls in spatie/laravel-package-tools ^1.16 and supports illuminate/contracts ^9|^10|^11, so it works with Laravel 9, 10, and 11.

Package Information

DetailValue
Packagistdiegobas/filament-drawable-map
LicenseMIT
AuthorDiego Bas Rius
NamespaceDiegoBas\FilamentDrawableMap

Build docs developers (and LLMs) love