jfsimon/gmap-bundle
jfsimon/gmap-bundle is a Symfony bundle for embedding Google Maps, with PHP and Twig helpers to configure maps, markers, and info windows and render them in templates. It simplifies adding customizable interactive maps to Symfony applications.
jfsimon/gmap-bundle is a Symfony 2 bundle ([DEVEL], 19 stars, 0 dependents). It has no Laravel support, no service provider, no facade, no config/gmap.php, and no compatibility with Laravel 8+ or PHP 8.x. On a fresh Laravel app the correct first step is composer require → conflict → composer remove → move on. Your "getting started" is really "deciding how much you want to learn from it."composer.json, first run composer show jfsimon/gmap-bundle to check version, constraints, and the abandoned flag. Then look, in this order, at:
Resources/config/services.xml — the actual service IDs and constructor arguments.DependencyInjection/Configuration.php — the config alias (likely jfsimon_gmap) and every supported option.Twig/ — the extension, function/filter names, and how the JS is emitted.Resources/views/ — the template partials the helper renders.GMap2, GLatLng, or GClientGeocoder you're on Google Maps JS API v2, which is retired — the bundle is functionally dead, not just unmaintained. If it emits google.maps.Map / google.maps.LatLng (v3), it's at least salvageable as a reference.Twig/ and Entity//Model/ directories and read them as a reference design for a ~200-line Laravel implementation. You'll get the domain shape (coordinate value object, map configuration object, geocoder wrapper) and skip the Symfony wiring entirely.Coordinate value object (lat/lng with validation), a Map configuration object (center, zoom, type, controls), and a marker list. Reimplement these as plain PHP classes under app/Support/Maps/ — no framework coupling, trivially unit-testable. This is the ~one-sprint build the PM assessment refers to.config/gmap.php, not the controller. Mirror the bundle's YAML-driven approach with a Laravel config file: defaults (zoom, map type, controls), api_key (from .env), and named map presets. This is the config-first pattern the bundle gets right and that you should keep.resources/views/components/gmap.blade.php (or <x-gmap> component) that is the only place the Google Maps JS is emitted. Every view calls the component. When the API key changes, the Maps JS version bumps, or you swap providers, you edit one file.MapData object (center, zoom, Marker[]) in a controller/action class and pass it to the component. This mirrors the bundle's "define in PHP, render in Twig" workflow but gives you testable seams — you can assertSee on rendered HTML and unit-test the DTO without a browser.Geocoder contract. Define interface Geocoder { public function geocode(string $address): ?Coordinate; } and implement GoogleGeocoder with Http::get('https://maps.googleapis.com/maps/api/geocode/json', ...). Bind it in a service provider. This is the direct replacement for whatever Geocoder service the bundle wraps, but mockable in tests — which the bundle never provided.map-{{ $id }}), and emit init JS keyed to that ID. The bundle's helper historically collides on id="map" — do not repeat that mistake when porting.data- attribute or a window.__MAPS__ script block, then have a small, untested-able-but-thin JS file read it. Do not string-interpolate JS from PHP inside Blade — that's the anti-pattern the bundle encourages and the reason it's hard to test.services.xml wiring with a Laravel service provider (GmapServiceProvider).[DEVEL] is not an adjective, it's a status flag. Packagist shows it; no stability guarantees; treat any output as subject to silent change. Pin it if you must vendor it, tag it internal-only, and log the debt.GMap2 is not defined in the console. This is not a config bug you can fix — it's the end of the road. Confirm with a one-line grep across the repo for GMap2|GLatLng.Your requirements could not be resolved. Do not attempt to force it — you'll fight the autoloader and lose.Twig/) has no analogue in Laravel. If you port the concept, write a Blade component or a @gmap directive — do not attempt to run Twig alongside Blade.DependencyInjection/Configuration.php for the true alias (jfsimon_gmap is likely), not the README. app/console config:dump-reference <alias> in the Symfony 2 app is the source of truth.div has height: 0 (the bundle's default CSS is often missing), (3) init JS runs before the Maps script loads — check <script> order in the rendered HTML, (4) invalid/absent API key.config/gmap.php — nested defaults, per-map overrides, named presets. Its Map object's option handling (types, controls, zoom) is also a fine starting list of what to expose via your Blade component's props. Copy the shape, not the implementation.How can I help you explore Laravel packages today?