From 4fa18e34525bfa4b61053dc105adf85fea23b3c8 Mon Sep 17 00:00:00 2001 From: Paola De Bartolo Date: Thu, 26 Sep 2024 09:59:16 -0300 Subject: [PATCH] fix: clear custom controls list as first step on setCustomControls --- .../java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java b/src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java index 0311065..07c13f6 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java +++ b/src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java @@ -787,6 +787,7 @@ public void addCustomControls(CustomControl... customControls) { * @param customControls list of custom controls to add to the map */ public void setCustomControls(CustomControl... customControls) { + this.customControls.clear(); this.getElement().executeJs("this._removeCustomControls()").then((e) -> { JsonArray jsonArray = Json.createArray(); for (int i = 0; i < customControls.length; i++) {