GoogleMaps 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;
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 set the initial frame, camera position, and mapID of the map view.\u003c/p\u003e\n"],["\u003cp\u003eIt allows customizing the background color displayed while map tiles load.\u003c/p\u003e\n"],["\u003cp\u003eDefaults are provided for frame (\u003ccode\u003eCGRectZero\u003c/code\u003e), camera (\u003ccode\u003enil\u003c/code\u003e), and background color (light grey).\u003c/p\u003e\n"]]],["`GMSMapViewOptions` provides initial settings for `GMSMapView`. Key options include: setting the `frame`, which defines the view's initial size and position, defaulting to `CGRectZero`; defining the initial `camera` position; specifying an optional `mapID` for advanced map functionalities; and setting the `backgroundColor` of the map, which is shown while tiles load, defaulting to light grey. Each option is set via a property.\n"],null,["# GoogleMaps 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;"]]