Send feedback
Add a 3D model to a map
Stay organized with collections
Save and categorize content based on your preferences.
This product or feature is Experimental (pre-GA).
Pre-GA products and features might have limited support, and changes to pre-GA products and
features might not be compatible with other pre-GA versions. Pre-GA Offerings are covered by
the Google
Maps Platform Service Specific Terms . For more information, see the
launch stage descriptions .
You can add your own imported 3D model to a 3D map.
The following code sample demonstrates how to add a 3D model and position it in 3D space using the Model
struct .
Swift
struct SimpleModelDemo : View {
@ State var camera : Camera = . init ( latitude : 37.791376 , longitude : - 122.397571 , altitude : 240 , heading : 288.0 , tilt : 88.0 , roll : 0.0 , range : 1500 )
@ State var balloonModel : Model = . init (
position : . init (
latitude : 37.791376 ,
longitude : - 122.397571 ,
altitude : 200.0 ),
url : URL ( string : "" ) ?? URL ( fileURLWithPath : fileUrl ),
altitudeMode : . relativeToMesh ,
scale : . init ( x : 5 , y : 5 , z : 5 ),
orientation : . init ( heading : 0 , tilt : 0 , roll : 0 )
)
var body : some View {
Map ( camera : $ camera , mode : . satellite ) {
balloonModel
}
}
}
private let fileUrl = Bundle . main . url ( forResource : "balloon" , withExtension : "glb" ) ! . path
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-06-05 UTC.
Need to tell us more?
[[["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."],[],[]]