GoogleNavigation Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSMapViewOptions
@interface GMSMapViewOptions : NSObject
This class defines initialization-time options for GMSMapView
.
-
Initial frame for the view. Defaults to CGRectZero
.
Declaration
Swift
var frame: CGRect { get set }
Objective-C
@property (nonatomic) CGRect frame;
-
Initial camera position. Defaults to nil.
-
The mapID for advanced map usage. Defaults to nil.
Declaration
Objective-C
@property (nonatomic, nullable) GMSMapID *mapID;
-
Specifies the background color of the map view, which displays whenever the map tiles are not
fully loaded. This is required because GMSMapView
ignores the inherited mutable
backgroundColor. The color is displayed on the background of the map. Defaults to a light grey
color.
Declaration
Swift
var backgroundColor: UIColor? { get set }
Objective-C
@property (nonatomic, nullable) UIColor *backgroundColor;
-
The screen the view will be used on.
Defaults to the main screen. Should be set to the CarPlay screen if this map view is to
be used with CarPlay.
Declaration
Swift
var screen: UIScreen! { get set }
Objective-C
@property (nonatomic, null_resettable) UIScreen *screen;
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-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSMapViewOptions\u003c/code\u003e configures the initial appearance and behavior of a \u003ccode\u003eGMSMapView\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize the initial frame, camera position, background color, and map ID.\u003c/p\u003e\n"],["\u003cp\u003eFor CarPlay integration, the \u003ccode\u003escreen\u003c/code\u003e property should be set accordingly.\u003c/p\u003e\n"],["\u003cp\u003eIf no initial camera is provided, the map defaults to a global view.\u003c/p\u003e\n"],["\u003cp\u003eBackground color can be changed, unlike with a standard view's \u003ccode\u003ebackgroundColor\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# GoogleNavigation Framework Reference\n\nGMSMapViewOptions\n=================\n\n @interface GMSMapViewOptions : NSObject\n\nThis class defines initialization-time options for [GMSMapView](../Classes/GMSMapView.html).\n- `\n ``\n ``\n `\n\n ### [frame](#/c:objc(cs)GMSMapViewOptions(py)frame)\n\n `\n ` \n Initial frame for the view. Defaults to `CGRectZero`. \n\n #### Declaration\n\n Swift \n\n var frame: CGRect { get set }\n\n Objective-C \n\n @property (nonatomic) CGRect frame;\n\n- `\n ``\n ``\n `\n\n ### [camera](#/c:objc(cs)GMSMapViewOptions(py)camera)\n\n `\n ` \n Initial camera position. Defaults to nil. \n\n #### Declaration\n\n Swift \n\n var camera: ../Classes/GMSCameraPosition.html? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) ../Classes/GMSCameraPosition.html *camera;\n\n- `\n ``\n ``\n `\n\n ### [mapID](#/c:objc(cs)GMSMapViewOptions(py)mapID)\n\n `\n ` \n The mapID for advanced map usage. Defaults to nil. \n\n #### Declaration\n\n Swift \n\n var mapID: ../Classes/GMSMapID.html? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) ../Classes/GMSMapID.html *mapID;\n\n- `\n ``\n ``\n `\n\n ### [backgroundColor](#/c:objc(cs)GMSMapViewOptions(py)backgroundColor)\n\n `\n ` \n Specifies the background color of the map view, which displays whenever the map tiles are not\n fully loaded. This is required because [GMSMapView](../Classes/GMSMapView.html) ignores the inherited mutable\n backgroundColor. The color is displayed on the background of the map. Defaults to a light grey\n color. \n\n #### Declaration\n\n Swift \n\n var backgroundColor: UIColor? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) UIColor *backgroundColor;\n\n[Navigation\n----------](#/Navigation)\n\n- `\n ``\n ``\n `\n\n ### [screen](#/c:objc(cs)GMSMapViewOptions(py)screen)\n\n `\n ` \n The screen the view will be used on.\n\n Defaults to the main screen. Should be set to the CarPlay screen if this map view is to\n be used with CarPlay. \n\n #### Declaration\n\n Swift \n\n var screen: UIScreen! { get set }\n\n Objective-C \n\n @property (nonatomic, null_resettable) UIScreen *screen;"]]