Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#367 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
PHP
Star
40
Fork
72
Merge trung bình
19 giờ
Pull request đã merge (30 ngày)
66

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fleetbase/fleetops

Tất cả issue của fleetbase/fleetops

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.