From 5a8399e4a05b4885036271c18dd22c6841ac8a4c Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Mon, 2 Oct 2023 16:34:01 +0200 Subject: [PATCH] fix(google-maps): Apply iconAnchor value to Marker anchor on Android (#1814) --- .../com/capacitorjs/plugins/googlemaps/CapacitorGoogleMap.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMap.kt b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMap.kt index d207f1e08..a22aa2208 100644 --- a/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMap.kt +++ b/google-maps/android/src/main/java/com/capacitorjs/plugins/googlemaps/CapacitorGoogleMap.kt @@ -772,6 +772,10 @@ class CapacitorGoogleMap( markerOptions.flat(marker.isFlat) markerOptions.draggable(marker.draggable) markerOptions.zIndex(marker.zIndex) + if (marker.iconAnchor != null) { + markerOptions.anchor(marker.iconAnchor!!.x, marker.iconAnchor!!.y) + } + if (!marker.iconUrl.isNullOrEmpty()) { if (this.markerIcons.contains(marker.iconUrl)) {