Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
clean a few code
Browse files Browse the repository at this point in the history
  • Loading branch information
jbdemonte committed Dec 3, 2016
1 parent e1b2aa0 commit f17933a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/gmap3.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
}

function ready(fn) {
if (document.readyState != 'loading'){
if (document.readyState != 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
Expand All @@ -103,7 +103,7 @@
}

// Auto-load google maps library if needed
(function () {
when(function () {
var dfd = deferred(),
cbName = '__gmap3',
script;
Expand All @@ -126,8 +126,8 @@
}
});

return dfd.promise();
})().then(function () {
return dfd;
}()).then(function () {
$.holdReady(false);
});

Expand Down Expand Up @@ -172,7 +172,7 @@
address: request
};
}
service('Geocoder').geocode(request, function(results, status) {
service('Geocoder').geocode(request, function (results, status) {
if (status === gm.GeocoderStatus.OK) {
dfd.resolve(results[0].geometry.location);
} else {
Expand All @@ -194,7 +194,7 @@
* @param {StringCallback} fn - Callback function
*/
function foreachStr(str, fn) {
str.split(' ').forEach(fn);
foreach(str.split(' '), fn);
}

/**
Expand Down Expand Up @@ -287,9 +287,7 @@
*/
function resolveArrayOfLatLng(options, key, fn) {
options = dupOpts(options);
options[key] = (options[key] || []).map(function (item) {
return toLatLng(item);
});
options[key] = (options[key] || []).map(toLatLng);
return resolved(fn(options));
}

Expand Down Expand Up @@ -391,7 +389,7 @@
self.draw();
};

self.draw = function() {
self.draw = function () {
var sw = fromLatLngToDivPixel(options.bounds.getSouthWest());
var ne = fromLatLngToDivPixel(options.bounds.getNorthEast());

Expand Down

0 comments on commit f17933a

Please sign in to comment.