After publishing the configuration file, you can set global defaults that apply to every map field across your Filament application. These defaults are used as the fallback values when no per-field overrides are provided, letting you centralise your map setup in one place rather than repeating coordinates or credentials on every field definition.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.
Publishing the config
Run the following Artisan command to copy the package configuration file into your application’sconfig/ directory:
config/filament-drawable-map.php with the following contents:
Config key reference
Your Google Maps JavaScript API key, read from the
GOOGLE_MAPS_API_KEY environment variable by default. The ViewableMap Blade template reads this config value directly via config('filament-drawable-map.providers.google.key') when constructing the Google Maps script URL. The DrawableMap Alpine component receives the key through window.filamentData.api.key, which the service provider populates by calling FilamentAsset::registerScriptData() with env('GOOGLE_MAPS_API_KEY') directly. Set this to null (or leave the env var unset) to disable map rendering.The default map center latitude in decimal degrees. This value is used by
ViewableMap as the initial map center when the field is rendered. When one or more polygons are present, the map automatically fits and pans to their combined bounds instead of using this fallback.The default map center longitude in decimal degrees. Works in tandem with
location.latitude as the fallback center point for ViewableMap fields. When polygons are present, the map auto-fits to their bounds and this value is not used.Per-field overrides
The globallocation defaults can be overridden on individual DrawableMap fields using the fluent ->location() and ->zoom() methods provided by the InteractsWithMap trait.
ViewableMap reads the center coordinates directly from the published config and does not expose a ->location() override. Instead, it automatically fits the viewport to the bounds of all rendered polygons whenever polygon data is available, so an explicit center is rarely needed.
Per-field
->location() and ->zoom() calls on DrawableMap always take precedence over the global config defaults. The global values in config/filament-drawable-map.php only apply when no per-field override is provided.