From 46bd85f24fc94248462c9084230e06656cdf0ec5 Mon Sep 17 00:00:00 2001 From: HikaruTakakura Date: Mon, 28 Sep 2020 23:25:39 +0900 Subject: [PATCH] prevent adding marker twice to `$clusterObject` --- gmap-custom-marker.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gmap-custom-marker.vue b/gmap-custom-marker.vue index 679038b..cefd871 100644 --- a/gmap-custom-marker.vue +++ b/gmap-custom-marker.vue @@ -43,10 +43,11 @@ export default { }, methods: { afterCreate(inst) { - if (this.$clusterPromise) { + if (this.$clusterPromise && !this.isMarkerAdded) { this.$clusterPromise.then(co => { co.addMarker(inst); this.$clusterObject = co; + this.isMarkerAdded = true; }); } }