cowegis / contao-geocoder
Geocoder integration in Contao CMS
Installs: 21
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 2
Type:contao-bundle
Requires
- php: >=7.1
- beberlei/assert: ^3.0
- contao-community-alliance/meta-palettes: ^2.0
- contao/core-bundle: ^4.4
- doctrine/cache: ^1.8
- doctrine/dbal: ^2.10
- geocoder-php/cache-provider: ^4.1
- geocoder-php/chain-provider: ^4.0
- geocoder-php/google-maps-provider: ^4.4
- geocoder-php/nominatim-provider: ^5.1
- netzmacht/contao-form-bundle: ^1.2
- netzmacht/contao-toolkit: ^3.5
- php-http/guzzle6-adapter: ^1.1 || ^2.0
- php-http/httplug: ^2.0
- psr/simple-cache: ^1.0
- roave/doctrine-simplecache: ^2.2
- symfony/config: ^3.3 || ^4.0
- symfony/dependency-injection: ^3.3 || ^4.0
- symfony/form: ^3.4 || ^4.0
- symfony/http-foundation: ^3.4 || ^4.0
- symfony/http-kernel: ^3.3 || ^4.0
- symfony/routing: ^3.4 || ^4.0
- symfony/twig-bundle: ^3.4 || ^4.0
- twig/twig: ^1.26 || ^2.0
- willdurand/geocoder: ^4.2
Requires (Dev)
- contao/manager-plugin: ^2.1
- doctrine/coding-standard: ^8.0
- phpcq/runner-bootstrap: ^1.0@dev
- phpspec/phpspec: ^6.0 || ^7.0
Conflicts
- contao/manager-plugin: <2.1 || >= 3.0
This package is auto-updated.
Last update: 2023-09-08 21:33:30 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
- Out of the box 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.4
- PHP
>= 7.1
Installation
Contao Manager
Search the cowegis/contao-geocoder
package and install it.
Composer
composer require cowegis/contao-geocoder ^0.2.0
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