pdir / geocode-cache-bundle
GeoCode Cache bundle for Contao 4
Installs: 45
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 0
Open Issues: 1
Type:contao-bundle
Requires
- php: ^5.6 || ^7.0
- contao/core-bundle: ^4.4
- opencage/geocode: ^2.1
- symfony/framework-bundle: ^3.3 || ^4.4
Requires (Dev)
- contao/manager-plugin: ^2.0
- doctrine/doctrine-cache-bundle: ^1.3
- friendsofphp/php-cs-fixer: ^2.12
- php-http/guzzle6-adapter: ^1.1
- php-http/message-factory: ^1.0.2
- phpunit/phpunit: 5.0 - 9.0
- symfony/phpunit-bridge: 4.0 - 5.1
Suggests
- pdir/maklermodul-bundle: GeoCode cache can be used for map integrations.
Conflicts
- contao/core: *
- contao/manager-plugin: <2.0 || >=3.0
This package is auto-updated.
Last update: 2024-10-28 19:21:04 UTC
README
About
The extension adds a new route /api/geocode/ to Contao and determines the latitude and longitude of an address.
As a service, the OpenCage geocoder is used. 2000 requests per day are free - see https://opencagedata.com/pricing.
All requests are stored in a database table.
Deutsch
Die Erweiterung fügt eine neue Route api/geocode zu Contao hinzu und ermittelt die Latitude und Longitude Angaben einer Adresse.
Als Dienst wird der OpenCage Geocoder verwendet. 2000 Anfrage pro Tag sind frei - see https://opencagedata.com/pricing.
Alle Anfragen werden in einer Datenbanktabelle gespeichert.
Example
Calling https://example.org/api/geocode/Ringstraße+9+28309+Bremen returns the following Json:
{ "lat": "53.0529439", "lng": "8.887199"}
Set API key and other parameters
app/config/parameters.yml
parameters:
pdir_gcb_opengage_api_key: INSERT_YOUR_OPENCAGE_API_KEY_HERE
pdir_gcb_cache_time: 1 day (default is 1 hour if noting is set)
System requirements
- Contao 4.0 or higher
Installation & Configuration
Dependencies
License
GNU Lesser General Public License v3.0
Tests & Coding Standard Checks
Run the PHP-CS-Fixer and the unit test before you release your bundle:
vendor/bin/php-cs-fixer fix -v vendor/bin/phpunit