radutopala/google-map-bundle
RaduTopala GoogleMapBundle is a Symfony bundle for integrating Google Maps into your application, offering helpers and services to render maps and handle map data. It aims to simplify embedding interactive maps, though it has minimal adoption and limited documentation.
This package is a Symfony2 bundle, not a Laravel package — there is no service provider, no facade, and no config/*.php. Before anything else, decide whether you can actually use it: the last release was July 2015 and 0 stars/dependents means nobody is maintaining it. If you're on Laravel 5+, plan to either (a) fork it and hand-wire the services, or (b) skip it and use the underlying ivory/google-map library directly for the map objects while rendering the JS yourself.
If you're on Symfony 2.x, the flow is:
composer require radutopala/google-map-bundle — pin an exact version; the constraint graph expects Symfony 2.x and PHP 5.x. On anything modern, expect to resolve conflicts or vendor it.app/AppKernel.php (new Ivory\GoogleMapBundle\IvoryGoogleMapBundle() — verify the class name against the repo, this fork is old).ivory_google_map:
api_key: "%google_maps_api_key%"
language: en
region: US
async: false
Where to look first: the Ivory\GoogleMap classes it wraps (Map, Marker, InfoWindow, Coordinate, MarkerCluster) and the bundle's Twig extension/helper services. Those two are the whole API surface.
First use case — one map with a marker, built in the controller and rendered in Twig:
$map = $this->get('ivory.google_map')->createMap();
$map->setCenter(new Coordinate(48.8566, 2.3522));
$map->setZoom(12);
$marker = new Marker();
$marker->setPosition(new Coordinate(48.8566, 2.3522));
$marker->setTitle('Paris');
$map->addMarker($marker);
{{ ivory_google_map_init() }}
{{ ivory_google_map(map) }}
ivory.google_map (the map builder) into a MapFactory-style service, return a configured Map, and pass it to the view. This is the only way to unit-test marker generation.createStoreMap(), createRouteMap()) keep options like zoom range, map type, and controls consistent across pages.$this->get('ivory.google_map.helper')->renderJs($map)) to return a script string for an endpoint, rather than the HTML renderer. This is the standard pattern for "filter markers without a page reload."MarkerCluster, add all your Marker objects to it, and add the cluster to the map instead of the individual markers — this is the normal way to handle more than ~100 pins.InfoWindow per marker with setContent(), and keep content generation in a Twig partial rendered server-side; the library only serializes the string.click handler that opens an info window). Treat the handler as raw JS.config.yml/parameters and merge per-page overrides, rather than hardcoding in controllers.PanControl/RotateControl were removed, Marker is superseded by AdvancedMarkerElement, and the recommended loading strategy is the async callback= bootstrap. The generated script tag from this bundle will not match current best practice — audit and patch the script-rendering helper.async: true, the map init must be wired to the API callback; otherwise you get google is not defined. Safest path is async: false plus explicit init helper call.Map gets a unique HTML id and JS variable name. Set these explicitly when rendering more than one map.ivory/google-map library itself is framework-agnostic and is the part worth keeping.Ivory\GoogleMap library.How can I help you explore Laravel packages today?