> For the complete documentation index, see [llms.txt](https://docs.mapbox.com/android/ja/maps/llms.txt)

# Multi map

![Using multiple MapboxMap in one Activity.](https://docs.mapbox.com/android/ja/assets/ideal-img/maps-compose-examples-display-multiple-maps.fae7dc9.480.png)

This example showcases the usage of multiple `MapboxMap` instances in the same screen. It includes two `MapboxMap` components within a `Column` layout, each displaying location annotations with different colors. The app sets [LightPreset](https://docs.mapbox.com/map-styles/standard/guides/#light-presets/) of the Mapbox Standard to either `day` or `night`. Location annotations are added using [`ViewAnnotation`](https://docs.mapbox.com/android/maps/api/latest/mapbox-maps-android/com.mapbox.maps.extension.compose.annotation/-view-annotation.html) with defined geometries and styling options.

Asynchronous operations using `LaunchedEffect` and `launch` from Kotlin coroutines are employed to update the location annotation lists after certain delays, `1000` and `2000` milliseconds respectively. The state of the lists is managed using `mutableStateOf` and `remember` to trigger UI updates. Additionally, `Point` from the `com.mapbox.geojson` package is used to represent geospatial points, and `CityLocations` is imported from the example's utilities to reference Helsinki's coordinates.

> **Note: Android Examples App Available**
> 
> This example code is part of the **Maps SDK for Android Examples App**, a working Android project [available on GitHub](https://github.com/mapbox/mapbox-maps-android/tree/v11.33.0/). Android developers are encouraged to run the examples app locally to interact with this example in an emulator and explore other features of the Maps SDK.
> 
> See our [Run the Maps SDK for Android Examples App](https://docs.mapbox.com/help/tutorials/maps-sdk-android-examples-app/) tutorial for step-by-step instructions.

**Kotlin**

Title: `MultiMapActivity.kt`

[View on GitHub](https://github.com/mapbox/mapbox-maps-android/blob/v11.33.0/compose-app/src/main/java/com/mapbox/maps/compose/testapp/examples/basic/MultiMapActivity.kt)

```kt
package com.mapbox.maps.compose.testapp.examples.basic

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Text
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import com.mapbox.geojson.Point
import com.mapbox.maps.compose.testapp.ExampleScaffold
import com.mapbox.maps.compose.testapp.examples.utils.CityLocations
import com.mapbox.maps.compose.testapp.ui.theme.MapboxMapComposeTheme
import com.mapbox.maps.extension.compose.MapboxMap
import com.mapbox.maps.extension.compose.animation.viewport.rememberMapViewportState
import com.mapbox.maps.extension.compose.annotation.ViewAnnotation
import com.mapbox.maps.extension.compose.style.standard.LightPresetValue
import com.mapbox.maps.extension.compose.style.standard.MapboxStandardStyle
import com.mapbox.maps.extension.compose.style.standard.ThemeValue
import com.mapbox.maps.extension.compose.style.standard.rememberStandardStyleState
import com.mapbox.maps.viewannotation.geometry
import com.mapbox.maps.viewannotation.viewAnnotationOptions
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

/**
 * Example to showcase usage of multiple of MapboxMap in the same screen.
 */
public class MultiMapActivity : ComponentActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContent {
      var viewAnnotationList1 by remember { mutableStateOf(emptyList<Point>()) }
      var viewAnnotationList2 by remember { mutableStateOf(emptyList<Point>()) }

      LaunchedEffect(Unit) {
        launch {
          delay(1000L)
          viewAnnotationList1 = points1
          viewAnnotationList2 = points1
        }
        launch {
          delay(2000L)
          viewAnnotationList2 = points1 + points2
        }
      }

      MapboxMapComposeTheme {
        ExampleScaffold {
          Column(modifier = Modifier.padding(it)) {
            MapboxMap(
              modifier = Modifier
                  .weight(1f)
                  .fillMaxWidth(),
              mapViewportState = rememberMapViewportState {
                setCameraOptions {
                  zoom(ZOOM)
                  center(CityLocations.HELSINKI)
                }
              },
              style = {
                MapboxStandardStyle(
                  standardStyleState = rememberStandardStyleState {
                    configurationsState.apply {
                      theme = ThemeValue.MONOCHROME
                      lightPreset = LightPresetValue.NIGHT
                    }
                  }
                )
              }
            ) {
              viewAnnotationList1.forEachIndexed { index, point ->
                ViewAnnotation(
                  options = viewAnnotationOptions {
                    geometry(point)
                    allowOverlap(true)
                  }
                ) {
                  Text(text = "Annotation $index", color = Color.Red)
                }
              }
            }
            MapboxMap(
              modifier = Modifier
                  .weight(1f)
                  .fillMaxWidth(),
              mapViewportState = rememberMapViewportState {
                setCameraOptions {
                  zoom(ZOOM)
                  center(CityLocations.HELSINKI)
                }
              },
              style = {
                MapboxStandardStyle(
                  standardStyleState = rememberStandardStyleState {
                    configurationsState.apply {
                      theme = ThemeValue.MONOCHROME
                    }
                  }
                )
              }
            ) {
              viewAnnotationList2.forEachIndexed { index, point ->
                ViewAnnotation(
                  options = viewAnnotationOptions {
                    geometry(point)
                    allowOverlap(true)
                  }
                ) {
                  Text(text = "Annotation $index", color = Color.Blue)
                }
              }
            }
          }
        }
      }
    }
  }

  private companion object {
    const val ZOOM: Double = 13.0
    val points1 = listOf(
      Point.fromLngLat(24.94216010242652, 60.16876757234266),
      Point.fromLngLat(24.929766009141733, 60.170292490574944),
    )
    val points2 = listOf(
      Point.fromLngLat(24.947481155604, 60.1731440090149),
      Point.fromLngLat(24.937481155604, 60.1631440090149)
    )
  }
}
```