update map (for arctic/antartic results)
This commit is contained in:
parent
8acccb5cd1
commit
23c50a1d01
2 changed files with 14 additions and 6 deletions
|
@ -851,22 +851,30 @@ Ox.Map = function(options, self) {
|
|||
|
||||
function parseGeodata(data) {
|
||||
var bounds = data.geometry.bounds || data.geometry.viewport,
|
||||
northEast = bounds.getNorthEast(),
|
||||
southWest = bounds.getSouthWest(),
|
||||
place = {
|
||||
alternativeNames: [],
|
||||
components: data.address_components,
|
||||
countryCode: getCountryCode(data.address_components),
|
||||
east: bounds.getNorthEast().lng(),
|
||||
east: northEast.lng(),
|
||||
editable: self.options.editable,
|
||||
fullGeoname: getFullGeoname(data.address_components),
|
||||
geoname: data.formatted_address,
|
||||
id: '_' + Ox.encodeBase32(Ox.uid()),
|
||||
map: that,
|
||||
name: data.formatted_address.split(', ')[0],
|
||||
north: bounds.getNorthEast().lat(),
|
||||
south: bounds.getSouthWest().lat(),
|
||||
north: northEast.lat(),
|
||||
south: southWest.lat(),
|
||||
type: getType(data.address_components[0].types),
|
||||
west: bounds.getSouthWest().lng()
|
||||
west: southWest.lng()
|
||||
};
|
||||
if (place.west == -180 && place.east == 180) {
|
||||
place.west = -179.99999999;
|
||||
place.east = 179.99999999;
|
||||
}
|
||||
place.south = Ox.limit(place.south, Ox.MIN_LATITUDE, Ox.MAX_LATITUDE);
|
||||
place.north = Ox.limit(place.north, Ox.MIN_LATITUDE, Ox.MAX_LATITUDE);
|
||||
function getCountryCode(components) {
|
||||
countryCode = '';
|
||||
Ox.forEach(components, function(component) {
|
||||
|
|
|
@ -2388,8 +2388,8 @@ Ox.formatDateRange = function(start, end, utc) {
|
|||
/*@
|
||||
Ox.formatDateRangeDuration <f> Formats the duration of a date range as a string
|
||||
A date range is a pair of arbitrary-presicion date strings
|
||||
> Ox.formatDateRangeDuration('2000-01-01 00:00:00', '2001-01-03 03:04:05')
|
||||
'1 year 2 days 3 hours 4 minutes 5 seconds'
|
||||
> Ox.formatDateRangeDuration('2000-01-01 00:00:00', '2001-03-04 04:05:06')
|
||||
'1 year 2 months 3 days 4 hours 5 minutes 6 seconds'
|
||||
> Ox.formatDateRangeDuration('1999', '2000', true)
|
||||
'1 year'
|
||||
> Ox.formatDateRangeDuration('2000', '2001', true)
|
||||
|
|
Loading…
Reference in a new issue