Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Google Map Form Type Bundle

Google Map Form Type Bundle Laravel Package

oh/google-map-form-type-bundle

A Symfony bundle that adds a Google Maps form type for selecting locations directly in your forms. Let users pick a point on an interactive map and store latitude/longitude with minimal configuration. Ideal for address, venue, or geolocation fields.

View on GitHub
Deep Wiki
Context7

Set latitude and longitude values on a form using Google Maps

Frequently asked questions about Google Map Form Type Bundle
Is oh/google-map-form-type-bundle compatible with Laravel?
No. It is a Symfony bundle that provides a Symfony Form type, and it ships no service provider, no publishable config, no Blade views, and no illuminate dependencies. The Laravel-Symfony Form bridge is not a supported path for wiring a bundle's Twig form theme into a Blade or Livewire stack. Treat it as a reference implementation to port, not a package to composer require.
What does the Google Map form type actually give me?
It renders an interactive Google Map inside a Symfony form with a draggable marker and address search, then syncs the marker position into two latitude and longitude fields. The genuinely reusable part is small front-end glue of roughly 80 to 150 lines: initialise the map at a default lat/lng/zoom, bind a draggable marker to two inputs, update those inputs on dragend and click, and handle the empty or partial-coordinate case. Everything else is Symfony 2 and 3 era ceremony.
How do I install and configure the bundle in a modern Symfony app?
In principle you add it with Composer, register the bundle, and use GoogleMapType as a form field while passing map options and your API key. In practice it predates the removal of AbstractType::getName(), the shift to configureOptions(), Symfony Flex recipes and bundles.php, and the Twig 2 and 3 form theme changes. Expect to fork and modernise it rather than simply bump a version constraint.
How do I add a Google Maps location picker to a Laravel Blade form?
Port the interaction instead of installing the bundle. Build a Blade component such as x-google-map-picker with a small vanilla JS or Alpine component, inject the key from config('services.google_maps.key'), and expose two named inputs for lat and lng. Then enforce server-side truth in a FormRequest so the map stays an input affordance and the database never receives unvalidated coordinates.
Why does my map show the 'For development purposes only' watermark or fail to load?
The Google Maps JavaScript API has required an API key tied to a billing-enabled account since 2018, and this bundle predates that requirement. You need a key restricted by HTTP referrer, an active billing account, and a Map ID if you move to AdvancedMarkerElement. Without those you get the watermark, a console error, or a blank canvas.
Is google.maps.Marker deprecated, and does this bundle still work?
Yes, google.maps.Marker is deprecated in favour of AdvancedMarkerElement, which requires a Map ID. The bundle renders the legacy marker, so you should expect console deprecation warnings and eventual breakage. It will likely still render for now, but plan the migration rather than building new work on top of it.
How should I validate latitude and longitude values in Laravel?
Use numeric with between:-90,90 for latitude and between:-180,180 for longitude, plus an either-both-or-neither rule so you never store a half-populated coordinate pair. A typical rule set is 'lat' => ['nullable','required_with:lng','numeric','between:-90,90'] with the mirror for 'lng'. Never trust the client values, because the marker position is trivially editable in devtools.
Is the package maintained, and does it support Symfony 5 to 7 or Laravel 10, 11 and 12?
The last release was 2016-07-21, with roughly 15 stars, zero dependents, no CI, no tests, no security policy, and a single maintainer. It has never supported Laravel in any form, and running it on Symfony 5 through 7 requires a fork rather than a version bump. You would be the only QA on the code.
What are the alternatives to this bundle for a map picker?
Leaflet or MapLibre with OpenStreetMap tiles needs no API key and carries no per-load billing, which makes it the cheapest option for a simple click-to-place marker. If you want Google specifically, the Google Maps Web Components or a server-side Places Autocomplete plus Geocoding API flow avoid most of the client JS. If you only need latitude and longitude capture and not reverse geocoding, the lighter libraries win comfortably.
What are the GDPR and CSP implications of embedding a Google Map?
Every map embed is a third-party request to Google and a billable Dynamic Maps load. Under GDPR and the ePrivacy Directive you generally need consent before that request fires in the EU, and the bundle does nothing to gate or defer it. It also has no CSP nonce support, so a strict Content-Security-Policy will need adapting around the injected script.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo