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.16k stars 143 forks source link

Add iOS target using Compose Multiplatform #312

Open dogeweb opened 1 year ago

dogeweb commented 1 year ago

Describe the solution you'd like Add platform-specific code for iOS, using JetBrains Compose Multiplatform.

JB Compose iOS support is now in Alpha compose-multiplatform/releases/tag/v1.4.0 and enables the use of UiKit views in Compose. Kotlin Multiplatform Mobile recently moved to Beta and cocoapods integration works: kotlinlang.org/docs/native-cocoapods.html

Since android-maps-compose library is a wrapper for an Android view, it may result easy to adapt the existing structure to wrap also iOS objective-c Maps sdk.

A quick implementation labeled as alpha could come handy for developers to start playing with it, while waiting JB Compose iOS support to exit Alpha state.

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.

@dogeweb 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.

wangela commented 1 year ago

This is interesting! Adding a help wanted tag and pinning for anyone who wants to explore what it takes to add Compose MP and iOS support.

lihenggui commented 1 year ago

An existing challenge with Compose multiplatform apps pertains to the availability of appropriate libraries for incorporating the Map feature. The prospect of Google extending its support in this regard holds immense potential, as it could significantly bolster the advancement of Compose Multiplatform apps.

realityexpander commented 1 year ago

I have had success with using compose for iOS with UIKitView to render google maps.

Maps are currently rendering on iOS and Android. All standard map interactivity is working. Markers and paths are displaying properly.

Here's a link to my repo.

https://github.com/realityexpander/ContactsComposeMultiplatform

The part I'm currently working on is the "on_Click" call backs. Right now I am not able to write custom map event callback handlers for "onClick" events. This is only a problem in the iOS stide.

I'm an Android dev, so I'm not sure whats necessary to make the work using Kotlin on the iOS side... all the sample code does not refer to this use case.

NOTE: Be sure to manually give location permission on the Android, I havent implemented that part yet.

you will need to get your own google maps api key.

This is still a work in progress, and its a good head start!

kikoso commented 1 year ago

Hi @realityexpander!

Thanks for the message, it is great to see that Android Maps for Compose can be used in KMP!

We merged recently https://github.com/googlemaps/android-maps-compose/pull/320, which introduced default values for the listeners. I suspect that this prevent listeners from working out of the box: default parameters in iOS are not supported, since the interoperability happens from Kotlin - Objective-C and Swift, so ultimately Objective-C needs to support them. I wrote an article about it here.

Touchlab released a couple of days SKIE, which promises to fix this issue. I haven't check it yet, but I would like to take a look. Eventually it seems that Android-Maps-Compose could work relatively out of the box for iOS.

realityexpander commented 1 year ago

So am I to understand that ive hit a dead end with looking to get "onMapClick" type of events from the Google MapView on iOS?

That I should probably wait on the Google Maps iOS "onMapClick" types of integrations?

That its likely not possible now without more low level work from the Google Maps team?

Should I file a bug report or feature request, or are they already aware of this issue and we are just waiting for them to catch up to KMP?

MascotWorld commented 1 year ago

So am I to understand that ive hit a dead end with looking to get "onMapClick" type of events from the Google MapView on iOS?

That I should probably wait on the Google Maps iOS "onMapClick" types of integrations?

That its likely not possible now without more low level work from the Google Maps team?

Should I file a bug report or feature request, or are they already aware of this issue and we are just waiting for them to catch up to KMP?

i found the way to handle click on marker:

val googleMapView = GMSMapView()
val delegate = object : NSObject(), GMSMapViewDelegateProtocol {
    //use this override, without nothing happend 
        override fun mapView(
            mapView: GMSMapView,
            didTapAtCoordinate: CValue<CLLocationCoordinate2D>
        ) {

        }

        override fun mapView(
            mapView: GMSMapView,
            didTapMarker: GMSMarker
        ): Boolean {
            val userData = didTapMarker.userData()
            println("gmios marker click ${userData}")
            return true
        }
    }

//uikitview
factory = {
                googleMapView.delegate = delegate
                return@UIKitView googleMapView
            }
realityexpander commented 1 year ago

image

My versions....

// gradle.properties
#Gradle
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"

#Kotlin
kotlin.code.style=official

#MPP
kotlin.mpp.stability.nowarn=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.androidSourceSetLayoutVersion=2

#Android
android.useAndroidX=true
android.compileSdk=34
android.targetSdk=34
android.minSdk=24

#Compose
org.jetbrains.compose.experimental.uikit.enabled=true

#Versions
kotlin.version=1.9.10
agp.version=8.0.2
compose.version=1.5.3

# Google Maps
google.maps.secrets-gradle-plugin.version=2.0.1
// build.gradle.kts(:shared)
val androidMain by getting {
            dependencies {

                api("androidx.activity:activity-compose:1.8.0")
                api("androidx.appcompat:appcompat:1.6.1")
                api("androidx.core:core-ktx:1.12.0")

                // Google maps for Compose for Android
                api("com.google.android.gms:play-services-location:21.0.1")
                api("com.google.android.gms:play-services-maps:18.1.0")
                implementation("com.google.maps.android:maps-compose:$mapsComposeVersion")
                // clustering
                implementation("com.google.maps.android:maps-compose-utils:$mapsComposeVersion")

                // Ktor Client for Android
                implementation("io.ktor:ktor-client-android:$ktorClientVersion")

                // For Logger in Android todo (why doesn't this automatically put this in shared android module?)
                api("co.touchlab:kermit:2.0.1")
            }
        }

Any ideas? Are you using the same versions?

MascotWorld commented 1 year ago

GMSMapViewDelegateProtocol

I was looking at your project to build mine. Yes, this error exists, but the application compiles and works :) I think we need to make an issue in the multiplatform compose branch, because the inability to add a delegate normally (I think so) is a library problem. image

MascotWorld commented 1 year ago
agp.version=8.1.2
android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=true
android.useAndroidX=true
compose.version=1.5.3
kotlin.code.style=official
kotlin.mpp.androidGradlePluginCompatibility.nowarn=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.mpp.enableCInteropCommonization=true
kotlin.version=1.9.10
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding\=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.jetbrains.compose.experimental.uikit.enabled=true

google.maps.secrets-gradle-plugin.version=2.0.1

and androidMain:

val androidMain by getting {
            dependencies {
                implementation("app.cash.sqldelight:android-driver:$sqlDelightVersion")
                implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
                implementation("androidx.appcompat:appcompat:1.6.1")
                api("androidx.core:core-ktx:1.10.1")
                implementation("io.insert-koin:koin-core:$koinVersion")
                implementation("io.insert-koin:koin-android:$koinVersion")
                // Google maps for Compose
                api("com.google.android.gms:play-services-location:21.0.1")
                api("com.google.android.gms:play-services-maps:18.1.0")
                implementation("com.google.maps.android:maps-compose:$mapsComposeVersion")
                // For clustering
                implementation("com.google.maps.android:maps-compose-utils:$mapsComposeVersion")
            }
        }
realityexpander commented 1 year ago

Yes, i have it working on the Android side with no problems... this is an iOS issue...

Can you show the iosMain gradle versions?

Do you have the functionality on the iOS side?

Are you receiving callbacks on the iOS side for the Google Maps?

Yes, it compiles... but does it execute?

realityexpander commented 1 year ago

I think we need to make an issue in the multiplatform compose branch, because the inability to add a delegate normally (I think so) is a library problem.

Where would that get posted? Im sure they know about it, the way im handling it on iOS side is a bit of hack, but it works, so we know it will improve from here.

MascotWorld commented 1 year ago

Yes, i have it working on the Android side with no problems... this is an iOS issue...

Can you show the iosMain gradle versions?

Do you have the functionality on the iOS side?

Are you receiving callbacks on the iOS side for the Google Maps?

Yes, it compiles... but does it execute?

Yes it works well on the iOS side. Above I have attached a screenshot where you can clearly see the log with the print.

 cocoapods {
        summary = "Some description for the Shared Module"
        homepage = "Link to the Shared Module homepage"
        version = "1.0"
        ios.deploymentTarget = "17.0"
        podfile = project.file("../iosApp/Podfile")
        framework {
            baseName = "shared"
            isStatic = true
        }
        pod("GoogleMaps") {
            version = "8.2.0"
        }
    }

Btw use "val googleMapView = GMSMapView()" not " val googleMapView = remember { GMSMapView() }" that helped me.

MascotWorld commented 1 year ago

GoogleMaps.zip it's from ur project, all working properly

realityexpander commented 1 year ago

OK, im confused here…

Is the Google Maps “tapOnMarker” functionality working for you on the iOS side?

Yes, it all works on Android, that’s not the problem.

Are you able to use the “tapOnMarker” callback on the iOS side, or just giving the compile warning and doesn’t actually received tap events?

Thanks for the responses!

Best, Chris

On Oct 19, 2023, at 2:19 AM, MascotWorld @.***> wrote:

GoogleMaps.zip https://github.com/googlemaps/android-maps-compose/files/13039249/GoogleMaps.zip it's from ur project, all working properly

— Reply to this email directly, view it on GitHub https://github.com/googlemaps/android-maps-compose/issues/312#issuecomment-1770207932, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHLEYXP5PS5ETQKUQE6JWDYADH7BAVCNFSM6AAAAAAXF6YCHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZQGIYDOOJTGI. You are receiving this because you were mentioned.

MascotWorld commented 1 year ago

OK, im confused here… Is the Google Maps “tapOnMarker” functionality working for you on the iOS side? Yes, it all works on Android, that’s not the problem. Are you able to use the “tapOnMarker” callback on the iOS side, or just giving the compile warning and doesn’t actually received tap events? Thanks for the responses! Best, Chris … On Oct 19, 2023, at 2:19 AM, MascotWorld @.***> wrote: GoogleMaps.zip https://github.com/googlemaps/android-maps-compose/files/13039249/GoogleMaps.zip it's from ur project, all working properly — Reply to this email directly, view it on GitHub <#312 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHLEYXP5PS5ETQKUQE6JWDYADH7BAVCNFSM6AAAAAAXF6YCHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZQGIYDOOJTGI. You are receiving this because you were mentioned.

The callback works great! you can check it yourself, I attached the file GoogleMaps.kt (from iosMain), you can replace it in your project and run it.

realityexpander commented 1 year ago

Looked at your info, and still not able to compile any GMSMapViewDelegateProtocol on the iOS side. Error is below.

OK, there must be a versions mismatch... Can I see your build.gradle.kts (:shared)

Thanks in advance! Best, Chris

image

MascotWorld commented 1 year ago

i have same error, but project is compiles. Here is whole project(with build files) with working click: https://drive.google.com/file/d/10vpPs69yPxUMNiTv9UCXuHbkDoVnTdru/view?usp=share_link You can check it out. in root is screen record where i show work

realityexpander commented 1 year ago

i have same error, but project is compiles. Here is whole project(with build files) with working click: https://drive.google.com/file/d/10vpPs69yPxUMNiTv9UCXuHbkDoVnTdru/view?usp=share_link You can check it out. in root is screen record where i show work

WOW! Thank you for supplying this...

I loaded your supplied project in both AS Giraffe and Hedgehog (Iguana is too new yet), and have the same problems...

Im now wondering what version of AS you are running?

Here's my version info:

Android Studio Giraffe | 2022.3.1 Patch 2
Build #AI-223.8836.35.2231.10811636, built on September 14, 2023
Runtime version: 17.0.6+0-17.0.6b829.9-10027231 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.5.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
    analyze.exceptions.on.the.fly=true
    external.system.auto.import.disabled=true
    debugger.new.tool.window.layout=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    ide.tooltip.initialDelay=812
    ide.experimental.ui=true
    ide.browser.jcef.gpu.disable=true

Non-Bundled Plugins:
    com.github.kaustubhpatange.composecolor (0.0.7)
    com.c5inco.modifiers (1.0.14)
    com.github.DerekBum.composeSlidesPresenter (0.1.2)
    com.github.copilot (1.3.2.3479)
    wu.seal.tool.jsontokotlin (3.7.4)
    idea.plugin.protoeditor (223.8214.6)
    com.wakatime.intellij.plugin (14.2.3)
    com.github.airsaid.androidlocalize (3.0.0)
    DBN (3.4.1620.0)
    net.seesharpsoft.intellij.plugins.csv (3.2.2-223)
    org.jetbrains.kotlin-js-inspection-pack-plugin (0.0.12)
    com.jetbrains.kmm (0.8.0(223)-25)
    com.squareup.sqldelight (2.0.0)
    com.developerphil.adbidea (1.6.12)
    org.jetbrains.compose.desktop.ide (1.5.3)
    by.overpass.svg-to-compose-intellij (0.12)
    mobi.hsz.idea.gitignore (4.4.4)
    com.abeade.plugin.figma.import (1.2.1)
Android Studio Hedgehog | 2023.1.1 RC 1
Build #AI-231.9392.1.2311.10949950, built on October 13, 2023
Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.5.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
    analyze.exceptions.on.the.fly=true
    external.system.auto.import.disabled=true
    debugger.new.tool.window.layout=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    ide.tooltip.initialDelay=812
    ide.experimental.ui=true
    ide.browser.jcef.gpu.disable=true

Non-Bundled Plugins:
    com.c5inco.modifiers (1.0.14)
    com.github.copilot (1.3.2.3479)
    wu.seal.tool.jsontokotlin (3.7.4)
    org.jetbrains.kotlin (231-1.9.20-RC-release-459-AS8109.175)
    idea.plugin.protoeditor (231.9225.5)
    com.wakatime.intellij.plugin (14.2.3)
    com.github.airsaid.androidlocalize (3.0.0)
    DBN (3.4.1620.0)
    net.seesharpsoft.intellij.plugins.csv (3.2.2-231)
    com.jetbrains.kmm (0.8.0(231)-19)
    com.squareup.sqldelight (2.0.0)
    com.developerphil.adbidea (1.6.11)
    org.jetbrains.compose.desktop.ide (1.5.3)
    by.overpass.svg-to-compose-intellij (0.12)
    mobi.hsz.idea.gitignore (4.5.2)
    com.abeade.plugin.figma.import (1.2.1)
MascotWorld commented 1 year ago

i have same error, but project is compiles. Here is whole project(with build files) with working click: https://drive.google.com/file/d/10vpPs69yPxUMNiTv9UCXuHbkDoVnTdru/view?usp=share_link You can check it out. in root is screen record where i show work

WOW! Thank you for supplying this...

I loaded your supplied project in both AS Giraffe and Hedgehog (Iguana is too new yet), and have the same problems...

Im now wondering what version of AS you are running?

Here's my version info:

Android Studio Giraffe | 2022.3.1 Patch 2
Build #AI-223.8836.35.2231.10811636, built on September 14, 2023
Runtime version: 17.0.6+0-17.0.6b829.9-10027231 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.5.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
    analyze.exceptions.on.the.fly=true
    external.system.auto.import.disabled=true
    debugger.new.tool.window.layout=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    ide.tooltip.initialDelay=812
    ide.experimental.ui=true
    ide.browser.jcef.gpu.disable=true

Non-Bundled Plugins:
    com.github.kaustubhpatange.composecolor (0.0.7)
    com.c5inco.modifiers (1.0.14)
    com.github.DerekBum.composeSlidesPresenter (0.1.2)
    com.github.copilot (1.3.2.3479)
    wu.seal.tool.jsontokotlin (3.7.4)
    idea.plugin.protoeditor (223.8214.6)
    com.wakatime.intellij.plugin (14.2.3)
    com.github.airsaid.androidlocalize (3.0.0)
    DBN (3.4.1620.0)
    net.seesharpsoft.intellij.plugins.csv (3.2.2-223)
    org.jetbrains.kotlin-js-inspection-pack-plugin (0.0.12)
    com.jetbrains.kmm (0.8.0(223)-25)
    com.squareup.sqldelight (2.0.0)
    com.developerphil.adbidea (1.6.12)
    org.jetbrains.compose.desktop.ide (1.5.3)
    by.overpass.svg-to-compose-intellij (0.12)
    mobi.hsz.idea.gitignore (4.4.4)
    com.abeade.plugin.figma.import (1.2.1)
Android Studio Hedgehog | 2023.1.1 RC 1
Build #AI-231.9392.1.2311.10949950, built on October 13, 2023
Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.5.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
    analyze.exceptions.on.the.fly=true
    external.system.auto.import.disabled=true
    debugger.new.tool.window.layout=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    ide.tooltip.initialDelay=812
    ide.experimental.ui=true
    ide.browser.jcef.gpu.disable=true

Non-Bundled Plugins:
    com.c5inco.modifiers (1.0.14)
    com.github.copilot (1.3.2.3479)
    wu.seal.tool.jsontokotlin (3.7.4)
    org.jetbrains.kotlin (231-1.9.20-RC-release-459-AS8109.175)
    idea.plugin.protoeditor (231.9225.5)
    com.wakatime.intellij.plugin (14.2.3)
    com.github.airsaid.androidlocalize (3.0.0)
    DBN (3.4.1620.0)
    net.seesharpsoft.intellij.plugins.csv (3.2.2-231)
    com.jetbrains.kmm (0.8.0(231)-19)
    com.squareup.sqldelight (2.0.0)
    com.developerphil.adbidea (1.6.11)
    org.jetbrains.compose.desktop.ide (1.5.3)
    by.overpass.svg-to-compose-intellij (0.12)
    mobi.hsz.idea.gitignore (4.5.2)
    com.abeade.plugin.figma.import (1.2.1)

this is my


Android Studio Giraffe | 2022.3.1 Patch 2
Build #AI-223.8836.35.2231.10811636, built on September 15, 2023
Runtime version: 17.0.6+0-17.0.6b829.9-10027231 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Metal Rendering is ON
Registry:
external.system.auto.import.disabled=true
debugger.new.tool.window.layout=true
ide.text.editor.with.preview.show.floating.toolbar=false
ide.experimental.ui=true

Non-Bundled Plugins: com.c5inco.modifiers (1.0.14) com.levinzonr.arch.jetpackcompose.plugin (1.1.0) com.jetbrains.kmm (0.6.1(223)-18) com.squareup.sqldelight (2.1.0-SNAPSHOT-1697294713387) org.jetbrains.compose.desktop.ide (1.5.3) com.thelumiereguy.compose_helper (2.0.4)

realityexpander commented 1 year ago

this is my

Android Studio Giraffe | 2022.3.1 Patch 2
    com.jetbrains.kmm (0.6.1(223)-18)

It looks like we are using different versions of the jetbrains KMM plugin. You have an earlier version, and mine is the latest... looks like they broke it in the latest version...

mine: com.jetbrains.kmm (0.8.0(223)-25) yours: com.jetbrains.kmm (0.6.1(223)-18)

Im going to explore if I can downgrade, or I'm locked in to the latest version.

MascotWorld commented 1 year ago

Maybe this is the point) Try downgrading and report back how it turned out

realityexpander commented 1 year ago

Just tried to use it with the 0.6.1 version of KMM plugin inside Flamingo (newer AS are incompatible and will not load the plugin) - Still has the same issue.

So, Im going to chalk this up as an unsolved mystery and await a better solution from google soon. At least the Android side works great, and compose is not an issue... It's a c-interop library issue.

Since they addressed it on the Android side for Google Maps in Compse, I can only assume Google or Jetbrains are working on this for compose for KMP.

MascotWorld commented 1 year ago

Just tried to use it with the 0.6.1 version of KMM plugin inside Flamingo (newer AS are incompatible and will not load the plugin) - Still has the same issue.

So, Im going to chalk this up as an unsolved mystery and await a better solution from google soon. At least the Android side works great, and compose is not an issue... It's a c-interop library issue.

Since they addressed it on the Android side for Google Maps in Compse, I can only assume Google or Jetbrains are working on this for compose for KMP.

can you show the error? my android studio itself updated the plugin (ahem) and I received an error related to Could not find "co.touchlab:stately-common" and I solved it)

realityexpander commented 1 year ago

Just tried to use it with the 0.6.1 version of KMM plugin inside Flamingo (newer AS are incompatible and will not load the plugin) - Still has the same issue.

So, Im going to chalk this up as an unsolved mystery and await a better solution from google soon. At least the Android side works great, and compose is not an issue... It's a c-interop library issue.

Since they addressed it on the Android side for Google Maps in Compse, I can only assume Google or Jetbrains are working on this for compose for KMP.

can you show the error? my android studio itself updated the plugin (ahem) and I received an error related to Could not find "co.touchlab:stately-common" and I solved it)

It's the same error as before

realityexpander commented 1 year ago

Its the exact same error as I have been showing in my previous replies.

Going back to previous versions of AS and KMM plug-in are not solutions for me at this time

Chris

On Oct 23, 2023, at 4:02 AM, MascotWorld @.***> wrote:

Just tried to use it with the 0.6.1 version of KMM plugin inside Flamingo (newer AS are incompatible and will not load the plugin) - Still has the same issue.

So, Im going to chalk this up as an unsolved mystery and await a better solution from google soon. At least the Android side works great, and compose is not an issue... It's a c-interop library issue.

Since they addressed it on the Android side for Google Maps in Compse, I can only assume Google or Jetbrains are working on this for compose for KMP. can you show the error? my android studio itself updated the plugin (ahem) and I received an error related to Could not find "co.touchlab:stately-common" and I solved it)

— Reply to this email directly, view it on GitHub https://github.com/googlemaps/android-maps-compose/issues/312#issuecomment-1774739041, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHLEYWNSGDD4QWZVZIA7Q3YAYXA7AVCNFSM6AAAAAAXF6YCHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZUG4ZTSMBUGE. You are receiving this because you were mentioned.

bubenheimer commented 12 months ago

@realityexpander there is a regression introduced in android-maps-compose 1.4.21 that causes recomposed GoogleMap listeners to not be used. Wonder if this might contribute to your obstacles. #466

realityexpander commented 11 months ago

Its a compile time issue, the compiler gives a warning and the listeners are not setup properly. This is an internal google library issue and hopefully there will be a fix soon.

yukarlo commented 11 months ago

The

override fun mapView(
            mapView: GMSMapView,
            didTapMarker: GMSMarker
) { 
...
}

definitely works. You just have to run the iOS app via Xcode and not via AS.

with AS, I have the same issue like you @realityexpander, I can't compile & have the same error (Return type is 'Boolean', which is not a subtype of overridden), thus can't run the iOS app via there.

Maybe you can try running the iOS app via xcode instead.

realityexpander commented 11 months ago

I'll give it a try, i did not try compiling and running from xcode.

UPDATE:

The app does indeed compile from XCode, but I was not able to get any responses from UI taps on iOS using either print statements or debug breakpoints.

Feel free to share your project and version information for all the libraries and IDE's...

ColtonIdle commented 11 months ago

Sharing support for Compose maps for kotlin multiplatform! Yes please!

realityexpander commented 11 months ago

I have made substantial progress on this by taking a different approach.

You can check my work at:

https://github.com/realityexpander/FredsRoadtripStoryteller

On Dec 19, 2023, at 8:47 AM, ColtonIdle @.***> wrote:

Sharing support for Compose maps for kotlin multiplatform! Yes please!

— Reply to this email directly, view it on GitHub https://github.com/googlemaps/android-maps-compose/issues/312#issuecomment-1862896870, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHLEYVFKDPL7K62YALHWTLYKGSJNAVCNFSM6AAAAAAXF6YCHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRSHA4TMOBXGA. You are receiving this because you were mentioned.

realityexpander commented 10 months ago

Here's a playlist on yt about how I approached the project: https://www.youtube.com/playlist?list=PLzUxWOrVXB4QmB3xvfjqkOMDZpwZnFb2x

KMP Proof of Concept - Part 3 - Shared UI Code walkthru

orelvis15 commented 4 months ago

@wangela Any news for this topic?

stevdza-san commented 4 months ago

This would definitely come in handy! Any new information on this topic?

Elelan commented 3 weeks ago

Any update on this?

stevdza-san commented 3 weeks ago

Any update on this?

In the meantime you could implement a platform specific logic. Watch my video: https://www.youtube.com/watch?v=Km2KxsWS-NU