pdir/geocode-cache-bundle

Contao 4 的 GeoCode Cache bundle

安装: 44

依赖: 0

建议者: 0

安全: 0

星星: 3

关注者: 4

分支: 0

开放问题: 1

类型:contao-bundle

1.1.0 2020-10-27 09:22 UTC

This package is auto-updated.

Last update: 2024-09-28 19:09:49 UTC


README

Latest Stable Version Total Downloads License

关于

此扩展为 Contao 添加了一个新的路由 /api/geocode/,并确定了地址的纬度和经度。作为一个服务,使用 OpenCage 地理编码器。每天 2000 次请求是免费的 - 请参阅 https://opencagedata.com/pricing
所有请求都存储在数据库表中。

德语

该扩展向 Contao 添加了新的路由 api/geocode,并确定了地址的纬度和经度。作为一个服务,使用 OpenCage 地理编码器。每天 2000 次请求是免费的 - 请参阅 https://opencagedata.com/pricing
所有请求都存储在数据库表中。

示例

调用 https://example.org/api/geocode/Ringstraße+9+28309+Bremen 返回以下 Json

{ "lat": "53.0529439", "lng": "8.887199"}

设置 API 密钥和其他参数

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)

系统要求

安装 & 配置

依赖项

许可

GNU Lesser General Public License v3.0

测试 & 编码标准检查

在发布您的包之前,运行 PHP-CS-Fixer 和单元测试

vendor/bin/php-cs-fixer fix -v
vendor/bin/phpunit