Skip to content
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

Merged
merged 3 commits into from
Mar 28, 2017
Merged

ES6: Migrated GeoLocation #951

merged 3 commits into from
Mar 28, 2017

Conversation

lipis
Copy link
Contributor

@lipis lipis commented Mar 27, 2017

No description provided.

@lipis lipis mentioned this pull request Mar 27, 2017
79 tasks
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];
Copy link
Contributor

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) {

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];
Copy link
Contributor

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) {

z.location = (() => {
const GOOGLE_GEOCODING_BASE_URL = 'https://maps.googleapis.com/maps/api/geocode/json';
const API_KEY = 'AIzaSyCKxxKw5JBZ5zEFtoirtgnw8omvH7gWzfo';
let _parse_results = results => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let _parse_results = (results) => {

const API_KEY = 'AIzaSyCKxxKw5JBZ5zEFtoirtgnw8omvH7gWzfo';
let _parse_results = results => {
let res = {};
let result = results[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let [result] = results;

}
return $.ajax({
url: `${GOOGLE_GEOCODING_BASE_URL}?latlng=${latitude},${longitude}&key=${API_KEY}`,
}).done(response => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

})
.done((response) => {

return resolve(_parse_results(response.results));
}
return resolve();
}).fail((jqXHR, textStatus, errorThrown) => reject(new Error(errorThrown)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

})
.fail(...

@lipis lipis merged commit f8a7c94 into dev Mar 28, 2017
@lipis lipis deleted the geolocation-js branch March 28, 2017 09:33
lipis added a commit that referenced this pull request Mar 28, 2017
* '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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants