From 6314d671a732ab42cb645961985ff2d917806abd Mon Sep 17 00:00:00 2001 From: choclate Date: Fri, 26 Aug 2016 14:04:17 +0200 Subject: [PATCH] fix: add debounce to computeUrl to remove angular2 multiple api error fix #67 --- google-maps-api.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/google-maps-api.html b/google-maps-api.html index fb9bbac..57769be 100644 --- a/google-maps-api.html +++ b/google-maps-api.html @@ -103,11 +103,20 @@ /** @private */ libraryUrl: { - type: String, - computed: '_computeUrl(mapsUrl, version, apiKey, clientId, language, signedIn)' + type: String } }, + observers: [ + '_debounceComputeUrl(mapsUrl, version, apiKey, clientId, language, signedIn)' + ], + + _debounceComputeUrl: function(mapsUrl, version, apiKey, clientId, language, signedIn) { + this.debounce('_computeUrl', function () { + this.libraryUrl = this._computeUrl(mapsUrl, version, apiKey, clientId, language, signedIn); + }, 0); + }, + _computeUrl: function(mapsUrl, version, apiKey, clientId, language, signedIn) { var url = mapsUrl + '&v=' + version;