Skip to content

Commit 5d42c7c

Browse files
author
Hirbod
committed
changed opacity check
1 parent a94ab45 commit 5d42c7c

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

www/googlemaps-cdv-plugin.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,10 +1356,6 @@ Marker.prototype.getParams = function() {
13561356
};
13571357
Marker.prototype.setOpacity = function(opacity) {
13581358
if (!opacity) {
1359-
return false;
1360-
}
1361-
var m = opacity.match(/^\d{0,2}(?:\.\d{0,2}){0,1}$/);
1362-
if (!m) {
13631359
console.log('opacity value must be int or double');
13641360
return false;
13651361
}
@@ -1811,6 +1807,10 @@ TileOverlay.prototype.getOpacity = function() {
18111807
return this.get('opacity');
18121808
};
18131809
TileOverlay.prototype.setOpacity = function(opacity) {
1810+
if (!opacity) {
1811+
console.log('opacity value must be int or double');
1812+
return false;
1813+
}
18141814
this.set('opacity', opacity);
18151815
cordova.exec(null, this.errorHandler, PLUGIN_NAME, 'exec', ['TileOverlay.setOpacity', this.getId(), opacity]);
18161816
};
@@ -1903,6 +1903,10 @@ GroundOverlay.prototype.getBearing = function() {
19031903
};
19041904

19051905
GroundOverlay.prototype.setOpacity = function(opacity) {
1906+
if (!opacity) {
1907+
console.log('opacity value must be int or double');
1908+
return false;
1909+
}
19061910
this.set('opacity', opacity);
19071911
cordova.exec(null, this.errorHandler, PLUGIN_NAME, 'exec', ['GroundOverlay.setOpacity', this.getId(), opacity]);
19081912
};

0 commit comments

Comments
 (0)