Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature: choose the geocoder provider by config (Google stays the default)

Aperta
#367 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
backend

Direzione di ricerca

Start by reading config/geocoder.php, Geocoding::makeGeocoder(), and the Place helpers that the issue identifies. The proposal also points to reverse lookups in driver track and POST /v1/places; inspect their existing tests and add Pest coverage for provider selection and failed lookups. Done means the maintainers resolve the two API/design questions and the proposed provider behavior is verified.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

Fleet-Ops geocodes only through Google Maps. config/geocoder.php chains only GoogleMaps, Geocoding::makeGeocoder() builds it directly, and the Place::...GoogleAddress helpers are typed to GoogleAddress.

Without a Google key, self-hosted installs get no address lookups, places created from an address stay at POINT(0 0), POST /v1/places with only coordinates returns 500, and each reverse lookup from driver track logs an ALERT. #337 is the same missing-key situation on the map settings.

Proposal

  • GEOCODER_PROVIDER picks an entry from a small registry of geocoder-php providers in config/geocoder.php. The default stays google, so existing installs don't change. First entries: google, pelias (PELIAS_URL) and nominatim (NOMINATIM_URL).
  • Google follows the selected provider in the chain only when a key is set.
  • GEOCODER_TIMEOUT (2 s) for non-Google providers, and a failed reverse lookup keeps the coordinates instead of throwing.
  • The Place helpers accept Geocoder\Location and use the Google-only fields only when the result has them.

This runs on our v0.7.68 install (fleetops 0.6.71) with Pelias and no Google key, with Pest tests.

Questions before we send a PR

  1. The registry with provider packages in suggest, Pelias in require, or Pelias only as a first step?
  2. For the Place helpers: widen the GoogleAddress types in place (a subclass override with the old type would then fail), or add generic methods and keep the Google-named ones as deprecated wrappers?

Why

Self-hosters could run Fleet-Ops without a Google account or with their own geocoder, and a missing key would stop causing 500s.

Lingua principale
PHP
Stelle
40
Fork
72
Merge medio
19h
PR unite (30g)
66

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fleetbase/fleetops

Tutte le issue di fleetbase/fleetops

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.