@@ -21,7 +21,6 @@ import com.mapconductor.example.MapViewContainer
2121import com.mapconductor.example.R
2222import android.os.Bundle
2323
24-
2524@Composable
2625fun StoreMapComponent (
2726 mapViewState : MapViewState <* >? ,
@@ -39,31 +38,37 @@ fun StoreMapComponent(
3938 }
4039 val context = LocalContext .current
4140 var isMarkerAnimating by remember { mutableStateOf(false ) }
42- val icons = mapOf (
43- " coffee_bean" to DrawableDefaultIcon (
44- backgroundDrawable = ContextCompat .getDrawable(context, R .drawable.coffee_bean)!!
45- ),
46- " honolulu_coffee" to DrawableDefaultIcon (
47- backgroundDrawable = ContextCompat .getDrawable(context, R .drawable.honolulu_coffee)!!
48- ),
49- " coffee_extra" to DrawableDefaultIcon (
50- backgroundDrawable = ContextCompat .getDrawable(context, R .drawable.coffee_extra)!!
51- ),
52- " starbucks" to DrawableDefaultIcon (
53- backgroundDrawable = ContextCompat .getDrawable(context, R .drawable.starbucks)!!
54- ),
55- )
5641
57- val markerList = remember {
58- markers.map { state ->
59- (state.extra as Bundle ).let { info ->
60- val store_icon = info.getString(" store" ) ? : " coffee_extra"
61- state.copy(
62- icon = icons[store_icon]
63- )
42+ val icons =
43+ mapOf (
44+ " coffee_bean" to
45+ DrawableDefaultIcon (
46+ backgroundDrawable = ContextCompat .getDrawable(context, R .drawable.coffee_bean)!! ,
47+ ),
48+ " honolulu_coffee" to
49+ DrawableDefaultIcon (
50+ backgroundDrawable = ContextCompat .getDrawable(context, R .drawable.honolulu_coffee)!! ,
51+ ),
52+ " coffee_extra" to
53+ DrawableDefaultIcon (
54+ backgroundDrawable = ContextCompat .getDrawable(context, R .drawable.coffee_extra)!! ,
55+ ),
56+ " starbucks" to
57+ DrawableDefaultIcon (
58+ backgroundDrawable = ContextCompat .getDrawable(context, R .drawable.starbucks)!! ,
59+ ),
60+ )
61+ val markerList =
62+ remember {
63+ markers.map { state ->
64+ (state.extra as Bundle ).let { info ->
65+ val storeIcon = info.getString(" store" ) ? : " coffee_extra"
66+ state.copy(
67+ icon = icons[storeIcon],
68+ )
69+ }
6470 }
6571 }
66- }
6772
6873 mapViewState?.let { currentMapViewState ->
6974 MapViewContainer (
0 commit comments