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
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions)
Log.d(TAG_LOGO, "create: ${context.packageName},\n$options")
val mapContext = MapContext(context)
MapsInitializer.initialize(mapContext)
val mapView = MapView(mapContext, options.toHms())
val mapView = MapView(mapContext, options.toHms()).apply { visibility = View.INVISIBLE }
this.mapView = mapView
view.addView(mapView)
mapView.onCreate(savedInstanceState?.toHms())
Expand Down Expand Up @@ -685,12 +685,17 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions)
}
internalOnInitializedCallbackList.clear()
fakeWatermark { Log.d(TAG_LOGO, "fakeWatermark success") }

mapView?.visibility = View.VISIBLE
}

tryRunUserInitializedCallbacks(tag = "initMap")
}

override fun onResume() = mapView?.onResume() ?: Unit
override fun onResume() {
mapView?.visibility = View.VISIBLE
mapView?.onResume()
}
override fun onPause() = mapView?.onPause() ?: Unit
override fun onDestroy() {
Log.d(TAG, "onDestroy")
Expand Down Expand Up @@ -723,6 +728,7 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions)
}

override fun onStop() {
mapView?.visibility = View.INVISIBLE
mapView?.onStop()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ class GoogleMapImpl(context: Context, var options: GoogleMapOptions) : AbstractG
override fun onCreate(savedInstanceState: Bundle?) {
if (!created) {
Log.d(TAG, "create");
val mapView = MapView(mapContext)
val mapView = MapView(mapContext).apply { visibility = View.INVISIBLE }
this.mapView = mapView
view.addView(mapView)
mapView.onCreate(savedInstanceState?.toMapbox())
Expand Down Expand Up @@ -800,6 +800,8 @@ class GoogleMapImpl(context: Context, var options: GoogleMapOptions) : AbstractG
}

isMyLocationEnabled = locationEnabled

view.visibility = View.VISIBLE
}
}
}
Expand Down Expand Up @@ -828,6 +830,7 @@ class GoogleMapImpl(context: Context, var options: GoogleMapOptions) : AbstractG

override fun onResume() {
Log.d(TAG, "onResume")
mapView?.visibility = View.VISIBLE
if (!isStarted) {
// onStart was not called, invoke mapView.onStart() now
mapView?.onStart()
Expand Down Expand Up @@ -886,6 +889,7 @@ class GoogleMapImpl(context: Context, var options: GoogleMapOptions) : AbstractG

override fun onStop() {
Log.d(TAG, "onStop")
mapView?.visibility = View.INVISIBLE
isStarted = false
mapView?.onStop()
}
Expand Down
Loading