Skip to content

Commit 6314d67

Browse files
committed
fix: add debounce to computeUrl to remove angular2 multiple api error
fix #67
1 parent cc61087 commit 6314d67

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: google-maps-api.html

+11-2
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,20 @@
103103

104104
/** @private */
105105
libraryUrl: {
106-
type: String,
107-
computed: '_computeUrl(mapsUrl, version, apiKey, clientId, language, signedIn)'
106+
type: String
108107
}
109108
},
110109

110+
observers: [
111+
'_debounceComputeUrl(mapsUrl, version, apiKey, clientId, language, signedIn)'
112+
],
113+
114+
_debounceComputeUrl: function(mapsUrl, version, apiKey, clientId, language, signedIn) {
115+
this.debounce('_computeUrl', function () {
116+
this.libraryUrl = this._computeUrl(mapsUrl, version, apiKey, clientId, language, signedIn);
117+
}, 0);
118+
},
119+
111120
_computeUrl: function(mapsUrl, version, apiKey, clientId, language, signedIn) {
112121
var url = mapsUrl + '&v=' + version;
113122

0 commit comments

Comments
 (0)