The following code sample demonstrates how to add a 3D model and position it in 3D space by calling the addModel method. To use this code sample, follow the instructions in Setup and Add a 3D map to your app to set up your Android Studio project with a basic 3D map. Then, add the following code to the MainActivity.kt file:
// Add imports and define constantsimportcom.google.android.gms.maps3d.model.latLngAltitudevalPLANE_URL="https://storage.googleapis.com/gmp-maps-demos/p3d-map/assets/Airplane.glb"valPLANE_SCALE=0.05// Add to the onMap3DViewReady method, after the googleMap3D object has been initializedgoogleMap3D.setCamera(camera{center=latLngAltitude{latitude=47.133971longitude=11.333161altitude=2200.0}heading=221.0tilt=65.0range=1_200.0})googleMap3D.addModel(modelOptions{id="plane_model"position=latLngAltitude{latitude=47.133971longitude=11.333161altitude=2200.0}altitudeMode=AltitudeMode.ABSOLUTEorientation=orientation{heading=41.5tilt=-90.0roll=0.0}url=PLANE_URLscale=vector3D{x=PLANE_SCALEy=PLANE_SCALEz=PLANE_SCALE}})
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-05 UTC."],[],[]]