-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES6: Migrated GeoLocation #951
Conversation
app/script/location/GeoLocation.js
Outdated
res['lng'] = result.geometry.location.lng; | ||
let ref = result.address_components; | ||
for (let i = 0, len = ref.length; i < len; i++) { | ||
let component = ref[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (let component of result.address_components) {
app/script/location/GeoLocation.js
Outdated
let component = ref[i]; | ||
let name = component.long_name || component.short_name; | ||
for (let j = 0, len1 = component.types.length; j < len1; j++) { | ||
let type = component.types[j]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (let type of component.types) {
app/script/location/GeoLocation.js
Outdated
z.location = (() => { | ||
const GOOGLE_GEOCODING_BASE_URL = 'https://maps.googleapis.com/maps/api/geocode/json'; | ||
const API_KEY = 'AIzaSyCKxxKw5JBZ5zEFtoirtgnw8omvH7gWzfo'; | ||
let _parse_results = results => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let _parse_results = (results) => {
app/script/location/GeoLocation.js
Outdated
const API_KEY = 'AIzaSyCKxxKw5JBZ5zEFtoirtgnw8omvH7gWzfo'; | ||
let _parse_results = results => { | ||
let res = {}; | ||
let result = results[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let [result] = results;
app/script/location/GeoLocation.js
Outdated
} | ||
return $.ajax({ | ||
url: `${GOOGLE_GEOCODING_BASE_URL}?latlng=${latitude},${longitude}&key=${API_KEY}`, | ||
}).done(response => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
})
.done((response) => {
app/script/location/GeoLocation.js
Outdated
return resolve(_parse_results(response.results)); | ||
} | ||
return resolve(); | ||
}).fail((jqXHR, textStatus, errorThrown) => reject(new Error(errorThrown))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
})
.fail(...
* 'dev' of github.com:wireapp/wire-webapp: eslint no-else-return rule (#954) Reenable Firefox 45 for ESR support but disable calling Calling v3 optimizations (WEBAPP-3772) (#937) ES6: Migrated "auth" directory (#947) ES6: Migrated GeoLocation (#951)
No description provided.