New basemap styling is coming soon to Google Maps Platform. This update to map styling includes a new default color palette, modernized pins, and improvements to map experiences and usability. All map styles will be automatically updated in March 2025. For more information on availability and how to opt in earlier, see
New map style for Google Maps Platform.
GoogleMaps Framework Reference
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 2024-11-15 UTC.
[null,null,["Last updated 2024-11-15 UTC."],[[["`GMSMapViewOptions` configures the initial appearance and behavior of a `GMSMapView`."],["You can set the initial frame, camera position, and mapID of the map view."],["It allows customizing the background color displayed while map tiles load."],["Defaults are provided for frame (`CGRectZero`), camera (`nil`), and background color (light grey)."]]],["`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"]]