Martin Feldsztejn
12/04/2025, 1:08 AMIcons library to get most icons, this is all nice and well, but it runs into issues when some of the composables are implemented natively. In my case I have a Map, and I've had to implement an expect fun MapView() that has 3 `actual`s (Android with GoogleMaps Compose, WasmJs with a JsExternal bridge, and iOS using the native MapKit). What I'm now trying to do, is change the icons of the markers to anything but the default, but because the implementations are native, I obviously can't use Icons or even Res..
What is the suggested way to do this?brandonmcansh
12/04/2025, 2:48 AMMartin Feldsztejn
12/04/2025, 3:13 AMexpect MapView that I implement in each platform, but then each uses whatever types are native to deal with the map.
Once you are in the specific sourceset (be it androidMain, wasmJsMain or iosMain) it requires Map types that are specific to the platform, so for example:
• in iOS, to draw a marker I use MKMarkerAnnotationView and to change the icon I need a UIImage
• for wasm I use a JsGoogleMap type, and I need to set a JsPinElement to it that uses a glyph to draw the icon
• for Android is the easiest one because its already in compose, so I can use all the assets in the Icons class there.
I guess I could create a resource in the iOSApp module as an xcasset, and then somehow reference the svg in web, but I'm trying to understand what the best practice method is.brandonmcansh
12/04/2025, 3:22 AMMartin Feldsztejn
12/04/2025, 4:45 AM