summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-12-29 14:30:15 -0800
committerBrion Vibber <brion@pobox.com>2009-12-29 14:30:15 -0800
commit96ce2262f8083756ea846d8b2c59fcc87f94b54c (patch)
treea7c50b87f9f2010563f756fcee1c9156976db907
parente3850e5273904a222580ff8daa3e778518721161 (diff)
If we got an identified location at ajax check time, renormalize lat/lon and naming. This'll match other displays of the names more consistently (Opera Plaza, San Francisco, CA, US instead of Opera Plaza, US)
-rw-r--r--actions/geocode.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/actions/geocode.php b/actions/geocode.php
index 7fd696baf..9671d2c27 100644
--- a/actions/geocode.php
+++ b/actions/geocode.php
@@ -52,7 +52,12 @@ class GeocodeAction extends Action
}
$this->lat = $this->trimmed('lat');
$this->lon = $this->trimmed('lon');
- $this->location = Location::fromLatLon($this->lat, $this->lon);
+ $location = Location::fromLatLon($this->lat, $this->lon);
+ if ($location) {
+ $this->location = Location::fromId($location->location_id, $location->location_ns);
+ $this->lat = $this->location->lat;
+ $this->lon = $this->location->lon;
+ }
return true;
}