From 27bfd823f174a3861e14b4bd9141274b1b2ac162 Mon Sep 17 00:00:00 2001 From: Paola De Bartolo Date: Mon, 23 Sep 2024 17:04:17 -0300 Subject: [PATCH] feat: remove all custom controls --- .../flowingcode/vaadin/addons/googlemaps/GoogleMap.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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 13d5f49..0498b39 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java +++ b/src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java @@ -820,6 +820,14 @@ public void removeCustomControl(CustomControl customControl) { this.setCustomControls(this.customControls.stream().toArray(CustomControl[]::new)); } + /** + * Removes all custom controls added to the map. + */ + public void removeCustomControls() { + this.customControls.clear(); + this.getElement().executeJs("this._removeCustomControls()"); + } + /** * Adds a FullScreenEvent listener. The listener is called to notify whether the map is in full * screen mode.