osynapsy/geocoding
最新稳定版本:1.0
Composer 安装命令:
composer require osynapsy/geocoding
包简介
Geocoding module for Osynapsy framework
README 文档
README
Un package professionale e flessibile per la geocodifica di indirizzi da usare in contesti backend-driven.
✨ Caratteristiche principali
- Provider multipli: Nominatim, Google, OpenCage
- Fallback automatico
- Supporto a endpoint configurabili e chiavi API esterne
- Interfaccia
ProviderInterface - Completamente testabile e conforme a PSR-4
🔧 Installazione
composer require osynapsy/geocoding
⚡ Esempio d'uso
use Osynapsy\Geocoding\Geocoder; use Osynapsy\Geocoding\Provider\Nominatim; use Osynapsy\Geocoding\Provider\Google; use Osynapsy\Geocoding\Provider\OpenCage; $geocoder = new Geocoder([ new Nominatim(), new Google('GOOGLE_API_KEY'), new OpenCage('OPENCAGE_API_KEY') ]); $location = $geocoder->locate('Via Roma 10, Milano'); if ($location) { echo $location->lat . ',' . $location->lng; }
🧱 Implementazione di un nuovo provider
Crea una classe che implementa ProviderInterface e implementa:
public function getCoordinates(string $address): ?Location;
📬 Contatti
Creato da Pietro Celeste per il framework Osynapsy.
⚠ Licenza
MIT
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-13