Select platform: [Android](https://developers.google.com/maps/documentation/maps-3d/android-sdk/add-3d-models.md.txt "View this page for the Android platform docs.") [iOS](https://developers.google.com/maps/documentation/maps-3d/ios-sdk/add-3d-models.md.txt "View this page for the iOS platform docs.") [JavaScript](https://developers.google.com/maps/documentation/javascript/3d/models.md.txt "View this page for the JavaScript platform docs.")

<br />

![A 3D model on a map](https://developers.google.com/static/maps/documentation/maps-3d/android-sdk/images/add-3d-model.png)

The following code sample demonstrates how to add a 3D model and position it
in 3D space by calling the
[`addModel`](https://developers.google.com/maps/documentation/maps-3d/android-sdk/reference/com/google/android/gms/maps3d/GoogleMap3D.md.txt#addModel(com.google.android.gms.maps3d.model.ModelOptions))
method. To use this code sample, follow the instructions in
[Setup](https://developers.google.com/maps/documentation/maps-3d/android-sdk/setup.md.txt) and [Add a 3D map to your
app](https://developers.google.com/maps/documentation/maps-3d/android-sdk/add-a-3d-map) to set up your
Android Studio project with a basic 3D map. Then, add the following code to the
**`MainActivity.kt`** file:

```kotlin
// Add imports and define constants
import com.google.android.gms.maps3d.model.Map3DMode
import com.google.android.gms.maps3d.model.latLngAltitude
val PLANE_URL = "https://storage.googleapis.com/gmp-maps-demos/p3d-map/assets/Airplane.glb"
val PLANE_SCALE = 0.05

// Add to the onMap3DViewReady method, after the googleMap3D object has been initialized
googleMap3D.setMapMode(Map3DMode.SATELLITE)
googleMap3D.setCamera(
   camera {
        center = latLngAltitude {
            latitude = 47.133971
            longitude = 11.333161
            altitude = 2200.0
        }
        heading = 221.0
        tilt = 65.0
        range = 1_200.0
    }
)

googleMap3D.addModel(
    modelOptions {
        id = "plane_model"
        position = latLngAltitude {
            latitude = 47.133971
            longitude = 11.333161
            altitude = 2200.0
        }
        altitudeMode = AltitudeMode.ABSOLUTE
        orientation = orientation {
            heading = 41.5
            tilt = -90.0
            roll = 0.0
        }
        url = PLANE_URL
        scale = vector3D {
            x = PLANE_SCALE
            y = PLANE_SCALE
            z = PLANE_SCALE
        }
    }
)
```

## Listen for 3D model click events

To listen for click events on a 3D model, call
`setClickListener` on the model object. The following example shows
how to set a click listener on a 3D model:

```kotlin
model.setClickListener {
    lifecycleScope.launch(Dispatchers.Main) {
        Toast.makeText(this@ModelsActivity, "Model clicked", Toast.LENGTH_SHORT).show()
    }
}
```

Note that the click handler does not run on the Main (or UI) thread. If you
want to make changes to the UI (such as showing a Toast message), you must
switch to the Main thread. For Kotlin, you can do this using
`lifecycleScope.launch(Dispatchers.Main)`.