Skip to content

Commit 73c0659

Browse files
committed
fix(android): isMyLocationButtonEnabled and use always custom LocationSource
1 parent cec18d7 commit 73c0659

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ class GoogleMapsViewImpl(
152152
super.addView(it)
153153
it.getMapAsync { map ->
154154
googleMap = map
155+
googleMap?.setLocationSource(locationHandler)
155156
googleMap?.setOnMapLoadedCallback {
156157
googleMap?.setOnCameraMoveStartedListener(this@GoogleMapsViewImpl)
157158
googleMap?.setOnCameraMoveListener(this@GoogleMapsViewImpl)
@@ -288,11 +289,7 @@ class GoogleMapsViewImpl(
288289
isCompassEnabled = value?.compassEnabled ?: false
289290
isIndoorLevelPickerEnabled = value?.indoorLevelPickerEnabled ?: false
290291
isMapToolbarEnabled = value?.mapToolbarEnabled ?: false
291-
292-
val myLocationEnabled = value?.myLocationButtonEnabled ?: false
293-
googleMap?.setLocationSource(if (myLocationEnabled) locationHandler else null)
294-
isMyLocationButtonEnabled = myLocationEnabled
295-
292+
isMyLocationButtonEnabled = value?.myLocationButtonEnabled ?: false
296293
isRotateGesturesEnabled = value?.rotateEnabled ?: true
297294
isScrollGesturesEnabled = value?.scrollEnabled ?: true
298295
isScrollGesturesEnabledDuringRotateOrZoom =

0 commit comments

Comments
 (0)