Skip to content

Fix geocoding fallback when AMap key is missing#21

Open
mlintangmz2765 wants to merge 1 commit into
mainfrom
codex/fix-all-bugs-p3y4tf
Open

Fix geocoding fallback when AMap key is missing#21
mlintangmz2765 wants to merge 1 commit into
mainfrom
codex/fix-all-bugs-p3y4tf

Conversation

@mlintangmz2765

Copy link
Copy Markdown
Owner

Motivation

  • Prevent unnecessary or invalid requests to AMap when amap_web_key is not configured and keep the Google fallback behavior safe.

Description

  • Add a guard in GeocodingService::getCoordinatesChina() to immediately return ['lat' => 0.0, 'lng' => 0.0] when the amap_web_key config is empty, avoiding calls to AMap endpoints.

Testing

  • Ran php -l app/Services/GeocodingService.php which passed; running composer test is currently blocked because vendor/autoload.php is missing in this environment.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant