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)

This commit is contained in:
Brion Vibber 2009-12-29 14:30:15 -08:00
parent e3850e5273
commit 96ce2262f8

View File

@ -52,7 +52,12 @@ class GeocodeAction extends Action
} }
$this->lat = $this->trimmed('lat'); $this->lat = $this->trimmed('lat');
$this->lon = $this->trimmed('lon'); $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; return true;
} }