googlemaps / android-maps-compose

Jetpack Compose composables for the Maps SDK for Android
https://developers.google.com/maps/documentation/android-sdk/maps-compose
Apache License 2.0
1.14k stars 135 forks source link

Cannot add shadow to custom Marker info content #318

Open MaxMichel2 opened 1 year ago

MaxMichel2 commented 1 year ago

Environment details

  1. Specify the API at the beginning of the title (for example, "Places: ...") - Maps directly
  2. OS type and version - Android 10+
  3. Library version and other environment information - google.android.maps-compose=2.11.4

Steps to reproduce

  1. Create a custom content in a MarkerInfoWindow and apply a shadow Modifier to it
  2. The shadow isn't applied and doesn't appear anywhere on the info window
wangela commented 1 year ago

If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.

@MaxMichel2 Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

kikoso commented 1 year ago

@MaxMichel2 , can you provide us with a code sample?

crgodfirnon commented 10 months ago

Hi @kikoso I can provide a sample.

MarkerInfoWindow(
        state = MarkerState(location),
        icon = if (isSelected) selectedDescriptor else unselectedDescriptor,
        onClick = {
            isSelected = true
            false
        },
        onInfoWindowClick = {

        },
        onInfoWindowClose = {
            isSelected = false
        }
    ) {
        // Has 8.dp of elevation
        CustomElevatedCard (
            modifier = Modifier
                .padding(horizontal = 24.dp)
        )
        // Also tried wrapping this in a container with shadow modifier w/ no luck 
    }

Hope this is helpful