diff --git a/src/GoogleMapViewController.ts b/src/GoogleMapViewController.ts index 9abc074..879b739 100644 --- a/src/GoogleMapViewController.ts +++ b/src/GoogleMapViewController.ts @@ -289,12 +289,14 @@ export class GoogleMapViewController // --- Lifecycle --- async clearOverlays(): Promise { - this.markerController.clear(); - this.circleController.clear(); - this.polylineController.clear(); - this.polygonController.clear(); - this.groundImageController.clear(); - this.rasterLayerController.clear(); + await this.clearOverlayControllers([ + this.markerController, + this.circleController, + this.polylineController, + this.polygonController, + this.groundImageController, + this.rasterLayerController, + ]); } /** diff --git a/src/GoogleMapViewController2D.ts b/src/GoogleMapViewController2D.ts index 75a44d3..b35fc82 100644 --- a/src/GoogleMapViewController2D.ts +++ b/src/GoogleMapViewController2D.ts @@ -314,12 +314,14 @@ export class GoogleMapViewController2D // --- Lifecycle --- async clearOverlays(): Promise { - this.markerController.clear(); - this.circleController.clear(); - this.polylineController.clear(); - this.polygonController.clear(); - this.groundImageController.clear(); - this.rasterLayerController.clear(); + await this.clearOverlayControllers([ + this.markerController, + this.circleController, + this.polylineController, + this.polygonController, + this.groundImageController, + this.rasterLayerController, + ]); } /**