Skip to content

Commit 00dbe35

Browse files
committed
Small bug fixes.
1 parent 1ef7e5a commit 00dbe35

1 file changed

Lines changed: 14 additions & 19 deletions

File tree

www/googlemaps-cdv-plugin.js

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ App.prototype.setDiv = function(div) {
703703
}
704704
if (currentDiv.classList) {
705705
currentDiv.classList.remove('_gmaps_cdv_');
706-
} else if (div.className) {
706+
} else if (currentDiv.className) {
707707
currentDiv.className = currentDiv.className.replace(/_gmaps_cdv_/g, "");
708708
currentDiv.className = currentDiv.className.replace(/\s+/g, " ");
709709
}
@@ -1031,21 +1031,16 @@ App.prototype.addGroundOverlay = function(groundOverlayOptions, callback) {
10311031
groundOverlayOptions.zIndex = groundOverlayOptions.zIndex || 1;
10321032
groundOverlayOptions.bounds = groundOverlayOptions.bounds || [];
10331033

1034-
var pluginExec = function() {
1035-
cordova.exec(function(result) {
1036-
var groundOverlay = new GroundOverlay(self, result.id, groundOverlayOptions);
1037-
OVERLAYS[result.id] = groundOverlay;
1038-
if (typeof groundOverlayOptions.onClick === "function") {
1039-
groundOverlay.on(plugin.google.maps.event.OVERLAY_CLICK, groundOverlayOptions.onClick);
1040-
}
1041-
if (typeof callback === "function") {
1042-
callback.call(self, groundOverlay, self);
1043-
}
1044-
}, self.errorHandler, PLUGIN_NAME, 'exec', ['GroundOverlay.createGroundOverlay', groundOverlayOptions]);
1045-
};
1046-
1047-
pluginExec();
1048-
1034+
cordova.exec(function(result) {
1035+
var groundOverlay = new GroundOverlay(self, result.id, groundOverlayOptions);
1036+
OVERLAYS[result.id] = groundOverlay;
1037+
if (typeof groundOverlayOptions.onClick === "function") {
1038+
groundOverlay.on(plugin.google.maps.event.OVERLAY_CLICK, groundOverlayOptions.onClick);
1039+
}
1040+
if (typeof callback === "function") {
1041+
callback.call(self, groundOverlay, self);
1042+
}
1043+
}, self.errorHandler, PLUGIN_NAME, 'exec', ['GroundOverlay.createGroundOverlay', groundOverlayOptions]);
10491044

10501045
};
10511046

@@ -1696,7 +1691,7 @@ var GroundOverlay = function(map, groundOverlayId, groundOverlayOptions) {
16961691

16971692
var self = this;
16981693
groundOverlayOptions.visible = groundOverlayOptions.visible === undefined ? true : groundOverlayOptions.visible;
1699-
groundOverlayOptions.zIndex = groundOverlayOptions.zIndex || 0;
1694+
groundOverlayOptions.zIndex = groundOverlayOptions.zIndex || 1;
17001695
groundOverlayOptions.opacity = groundOverlayOptions.opacity || 1;
17011696
groundOverlayOptions.bounds = groundOverlayOptions.bounds || [];
17021697
groundOverlayOptions.anchor = groundOverlayOptions.anchor || [0, 0];
@@ -1929,8 +1924,8 @@ function isHTMLColorString(inputValue) {
19291924
inputValue.match(/^#[0-9A-F]{4}$/i) ||
19301925
inputValue.match(/^#[0-9A-F]{6}$/i) ||
19311926
inputValue.match(/^#[0-9A-F]{8}$/i) ||
1932-
inputValue.match(/^rgba\([\d,.\s]+\)$/) ||
1933-
inputValue.match(/^hsla\([\d%,.\s]+\)$/)) {
1927+
inputValue.match(/^rgba?\([\d,.\s]+\)$/) ||
1928+
inputValue.match(/^hsla?\([\d%,.\s]+\)$/)) {
19341929
return true;
19351930
}
19361931

0 commit comments

Comments
 (0)