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.