cowegis/contao-geocoder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cowegis/contao-geocoder

最新稳定版本:1.0.2

Composer 安装命令:

composer require cowegis/contao-geocoder

包简介

Geocoder integration in Contao CMS

README 文档

README

Build Status Version License Downloads

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 and google 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

统计信息

  • 总下载量: 318
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 1

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2019-06-04