Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ import java.io.ByteArrayInputStream
import java.nio.charset.StandardCharsets

class GoogleMapsViewImpl(
val reactContext: ThemedReactContext,
val locationHandler: LocationHandler,
val playServiceHandler: PlayServicesHandler,
val markerBuilder: MapMarkerBuilder,
val mapErrorHandler: MapErrorHandler,
private val reactContext: ThemedReactContext,
private val locationHandler: LocationHandler,
private val playServiceHandler: PlayServicesHandler,
private val markerBuilder: MapMarkerBuilder,
private val mapErrorHandler: MapErrorHandler,
) : FrameLayout(reactContext),
GoogleMap.OnCameraMoveStartedListener,
GoogleMap.OnCameraMoveListener,
Expand Down Expand Up @@ -96,7 +96,7 @@ class GoogleMapsViewImpl(
private val pendingCircles = mutableListOf<Pair<String, CircleOptions>>()
private val pendingHeatmaps = mutableListOf<Pair<String, TileOverlayOptions>>()
private val pendingKmlLayers = mutableListOf<Pair<String, String>>()
private val pendingUrlTilesOverlays = mutableListOf<Pair<String, TileOverlayOptions>>()
private val pendingUrlTileOverlays = mutableListOf<Pair<String, TileOverlayOptions>>()

private val markersById = mutableMapOf<String, Marker>()
private val polylinesById = mutableMapOf<String, Polyline>()
Expand Down Expand Up @@ -268,9 +268,9 @@ class GoogleMapsViewImpl(
pendingKmlLayers.forEach { (id, str) -> addKmlLayerInternal(id, str) }
pendingKmlLayers.clear()
}
if (pendingUrlTilesOverlays.isNotEmpty()) {
pendingUrlTilesOverlays.forEach { (id, opts) -> addUrlTileOverlayInternal(id, opts) }
pendingUrlTilesOverlays.clear()
if (pendingUrlTileOverlays.isNotEmpty()) {
pendingUrlTileOverlays.forEach { (id, opts) -> addUrlTileOverlayInternal(id, opts) }
pendingUrlTileOverlays.clear()
}
}

Expand Down Expand Up @@ -775,7 +775,7 @@ class GoogleMapsViewImpl(
opts: TileOverlayOptions,
) = onUi {
if (googleMap == null) {
pendingUrlTilesOverlays.add(id to opts)
pendingUrlTileOverlays.add(id to opts)
return@onUi
}
urlTileOverlaysById.remove(id)?.remove()
Expand Down Expand Up @@ -805,7 +805,7 @@ class GoogleMapsViewImpl(
it.remove()
}
urlTileOverlaysById.clear()
pendingUrlTilesOverlays.clear()
pendingUrlTileOverlays.clear()
}

fun destroyInternal() =
Expand Down
4 changes: 2 additions & 2 deletions android/src/main/java/com/rngooglemapsplus/LocationHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private const val INTERVAL_DEFAULT = 600000L
private const val MIN_UPDATE_INTERVAL = 3600000L

class LocationHandler(
val context: ReactContext,
private val context: ReactContext,
) : LocationSource {
private val fusedLocationClientProviderClient: FusedLocationProviderClient =
LocationServices.getFusedLocationProviderClient(context)
Expand Down Expand Up @@ -68,7 +68,7 @@ class LocationHandler(
val activity = context.currentActivity ?: run { return@onUi }

val lr =
if (Build.VERSION.SDK_INT >= 31) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 10_000L).build()
} else {
@Suppress("DEPRECATION")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import java.util.concurrent.ConcurrentHashMap
import kotlin.coroutines.cancellation.CancellationException

class MapMarkerBuilder(
val context: ThemedReactContext,
private val context: ThemedReactContext,
private val mapErrorHandler: MapErrorHandler,
private val scope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.GoogleApiAvailability

class PlayServicesHandler(
val context: ReactContext,
private val context: ReactContext,
) {
fun playServicesAvailability(): Int {
val availability = GoogleApiAvailability.getInstance()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.rngooglemapsplus.extensions.toSize

@DoNotStrip
class RNGoogleMapsPlusView(
val context: ThemedReactContext,
private val context: ThemedReactContext,
) : HybridRNGoogleMapsPlusViewSpec() {
private val mapErrorHandler = MapErrorHandler()

Expand Down
1 change: 0 additions & 1 deletion ios/GoogleMapViewImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ GMSIndoorDisplayDelegate {
}
}

var onMapError: ((RNMapErrorCode) -> Void)?
var onMapReady: ((Bool) -> Void)?
var onMapLoaded: ((RNRegion, RNCamera) -> Void)?
var onLocationUpdate: ((RNLocation) -> Void)?
Expand Down
Loading