cowegis / contao-geocoder
Geocoder integration in Contao CMS
Installs: 83
Dependents: 1
Suggesters: 1
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 4
Type:contao-bundle
Requires
- php: ^8.2
- beberlei/assert: ^3.0
- contao-community-alliance/meta-palettes: ^2.0
- contao/core-bundle: ^4.13 || ^5.3
- doctrine/dbal: ^3.4
- geocoder-php/cache-provider: ^4.1
- geocoder-php/chain-provider: ^4.0
- netzmacht/contao-form-bundle: ^2.0
- netzmacht/contao-toolkit: ^3.9 || ^4.0
- nyholm/psr7: ^1.8
- psr/http-client: ^1.0
- psr/simple-cache: ^1.0
- symfony/cache: ^5.4 || ^6.4
- symfony/config: ^5.4 || ^6.4
- symfony/dependency-injection: ^5.4 || ^6.4
- symfony/http-client: ^5.4 || ^6.4
- symfony/http-foundation: ^5.4 || ^6.4
- symfony/http-kernel: ^5.4 || ^6.4
- symfony/routing: ^5.4 || ^6.4
- symfony/twig-bundle: ^5.4 || ^6.4
- twig/twig: ^3.0
- willdurand/geocoder: ^4.6
Requires (Dev)
- contao/manager-plugin: ^2.1
- doctrine/coding-standard: ^12.0
- geocoder-php/google-maps-provider: ^4.4
- geocoder-php/nominatim-provider: ^5.1
- netzmacht/phpspec-phpcq-plugin: @dev
- phpcq/runner-bootstrap: @dev
- phpspec/phpspec: ^6.0 || ^7.0
Suggests
- geocoder-php/google-maps-provider: Required for Google Maps API support
- geocoder-php/nominatim-provider: Required for Nominatim support
Conflicts
- contao/manager-plugin: <2.1 || >= 3.0
- geocoder-php/google-maps-provider: <4.4 || >= 5.0
- geocoder-php/nominatim-provider: <5.0 || >= 6.0
This package is auto-updated.
Last update: 2024-12-17 09:47:37 UTC
README
This extension integrates the Geocoder PHP library into Contao CMS. It's designed for other extensions to use a common geocoder implementation.
Features
- Geocoder service for other extensions
- Built in support for
nominatim
andgoogle maps
- Extandable for other providers
- Database driven configuration of providers in Contao backend
- Application driven configuration of providers
- API endpoint for geocode queries
Requirements
- Contao
^4.13 || ^5.3
- PHP
^8.2
Installation
composer require cowegis/contao-geocoder ^1.0.0
# Optional for Nominatim support
composer require geocoder-php/nominatim-provider ^5.5
# Optional for Google Maps support
composer require geocoder-php/google-maps-provider ^4.6
Usage
Configuration
Optional application configuration
# app/config/config.yml cowegis_contao_geocoder: providers: foo: title: "Foo Geocoder" type: "google_maps" google_api_key: "ABC" bar: title: "Bar Geocoder" type: "nominatim" default_provider: "bar"
Code example
<?php use Cowegis\ContaoGeocoder\Provider\Geocoder; final class MyService { private $geocoder; public function __construct(Geocoder $geocoder) { $this->geocoder = $geocoder; } public function geocode(string $address) : \Geocoder\Location { return $this->geocoder // Optional use a specific geocoder. Otherwise the default provider is used ->using('foo') ->geocodeQuery(\Geocoder\Query\GeocodeQuery::create($address)) ->first(); } }
License
This extension is licensed under LGPL-3.0-or-later