forked from 0x2620/oxjs
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue