Is your feature request related to a problem? Please describe.
It's too easy to use Composables not intended for rendering to the map inside the GoogleMap content lambda. If I pass in a Column for example, the only hint I get is a non specific crash in Logcat:
Process: com.example.composeformaps, PID: 8771
java.lang.ClassCastException: androidx.compose.ui.node.LayoutNode cannot be cast to com.google.maps.android.compose.MapNode
at com.google.maps.android.compose.MapApplier.insertTopDown(MapApplier.kt:34)
at androidx.compose.runtime.ComposerImpl$createNode$2.invoke(Composer.kt:1613)
at androidx.compose.runtime.ComposerImpl$createNode$2.invoke(Composer.kt:1608)
at androidx.compose.runtime.ComposerImpl$recordInsert$2.invoke(Composer.kt:3546)
at androidx.compose.runtime.ComposerImpl$recordInsert$2.invoke(Composer.kt:3543)
at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:818)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:849)
at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:1041)
at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:4007)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:520)
at com.google.maps.android.compose.GoogleMapKt$GoogleMap$10.invokeSuspend(GoogleMap.kt:239)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@293cb98, androidx.compose.runtime.BroadcastFrameClock@862ff1, StandaloneCoroutine{Cancelling}@12407d6, AndroidUiDispatcher@c3eba57]
Describe the solution you'd like
A warning or error triggered within the IDE, informing the developer of a possible misuse of a composable.
Describe alternatives you've considered
I'm conscious GoogleMapComposable is available to help with this. I am not sure it is working as extended. I see no warning when passing a non GoogleMapComposable into a GoogleMap.
Additional context
See #335 for an example of this situation.
Is your feature request related to a problem? Please describe.
It's too easy to use Composables not intended for rendering to the map inside the GoogleMap
contentlambda. If I pass in aColumnfor example, the only hint I get is a non specific crash in Logcat:Describe the solution you'd like
A warning or error triggered within the IDE, informing the developer of a possible misuse of a composable.
Describe alternatives you've considered
I'm conscious
GoogleMapComposableis available to help with this. I am not sure it is working as extended. I see no warning when passing a nonGoogleMapComposableinto aGoogleMap.Additional context
See #335 for an example of this situation.