GoogleMaps Framework Reference

Classes

The following classes are available globally.

  • A result from a reverse geocode request, containing a human-readable address. This class is immutable and should not be instantiated directly unless under testing circumstances. Obtain an instance via GMSGeocoder.

    Some of the fields may be nil, indicating they are not present.

    Declaration

    Swift

    class GMSAddress : NSObject, NSCopying, NSSecureCoding

    Objective-C

    @interface GMSAddress : NSObject <NSCopying, NSSecureCoding>
  • An advanced marker is an icon placed at a particular point on the map’s surface.

    Declaration

    Swift

    class GMSAdvancedMarker : GMSMarker

    Objective-C

    @interface GMSAdvancedMarker : GMSMarker
  • GMSCALayer is a superclass used by layers in the Google Maps SDK for iOS, such as GMSMapLayer and GMSPanoramaLayer.

    This is an implementation detail and it should not be instantiated directly.

    Declaration

    Swift

    class GMSCALayer : CALayer

    Objective-C

    @interface GMSCALayer : CALayer
  • An immutable class that aggregates all camera position parameters.

    Declaration

    Swift

    class GMSCameraPosition : NSObject, NSCopying, NSMutableCopying

    Objective-C

    @interface GMSCameraPosition : NSObject <NSCopying, NSMutableCopying>
  • Mutable version of GMSCameraPosition.

    Declaration

    Swift

    class GMSMutableCameraPosition : GMSCameraPosition

    Objective-C

    @interface GMSMutableCameraPosition : GMSCameraPosition
  • GMSCameraUpdate represents an update that may be applied to a GMSMapView.

    It encapsulates some logic for modifying the current camera.

    It should only be constructed using the factory helper methods below.

    Declaration

    Swift

    class GMSCameraUpdate : NSObject

    Objective-C

    @interface GMSCameraUpdate : NSObject
  • A circle on the Earth’s surface (spherical cap).

    Declaration

    Swift

    class GMSCircle : GMSOverlay

    Objective-C

    @interface GMSCircle : GMSOverlay
  • GMSCoordinateBounds represents a rectangular bounding box on the Earth’s surface. GMSCoordinateBounds is immutable and can’t be modified after construction.

    Declaration

    Swift

    class GMSCoordinateBounds : NSObject

    Objective-C

    @interface GMSCoordinateBounds : NSObject
  • An interface representing a feature from a dataset.

    The featureType of a DatasetFeature will always be GMSFeatureTypeDataset.

    Declaration

    Swift

    class DatasetFeature : NSObject, Feature

    Objective-C

    
    @interface GMSDatasetFeature : NSObject <GMSFeature>
  • An interface representing a feature layer for a dataset.

    The featureType of a GMSDatasetFeatureLayer will always be GMSFeatureTypeDataset.

    Declaration

    Swift

    class DatasetFeatureLayer : FeatureLayer<DatasetFeature>

    Objective-C

    
    @interface GMSDatasetFeatureLayer : GMSFeatureLayer <GMSDatasetFeature *>
  • A class representing a collection of all features of the same GMSFeatureType, whose style can be overridden on the client. Each GMSFeatureType will have one corresponding GMSFeatureLayer.

    Declaration

    Swift

    class FeatureLayer<T> : NSObject where T : Feature

    Objective-C

    
    @interface GMSFeatureLayer<__covariant T : id <GMSFeature>> : NSObject
  • Specifies how a map feature should appear when displayed on a map.

    Declaration

    Swift

    class FeatureStyle : NSObject, NSCopying, NSMutableCopying

    Objective-C

    
    @interface GMSFeatureStyle : NSObject <NSCopying, NSMutableCopying>
  • Mutable version of GMSFeatureStyle.

    Declaration

    Swift

    class MutableFeatureStyle : FeatureStyle

    Objective-C

    
    @interface GMSMutableFeatureStyle : GMSFeatureStyle
  • Exposes a service for reverse geocoding. This maps Earth coordinates (latitude and longitude) to a collection of addresses near that coordinate.

    Declaration

    Swift

    class GMSGeocoder : NSObject

    Objective-C

    @interface GMSGeocoder : NSObject
  • A collection of results from a reverse geocode request.

    Declaration

    Swift

    class GMSReverseGeocodeResponse : NSObject, NSCopying

    Objective-C

    @interface GMSReverseGeocodeResponse : NSObject <NSCopying>
  • GMSGroundOverlay specifies the available options for a ground overlay that exists on the Earth’s surface. Unlike a marker, the position of a ground overlay is specified explicitly and it does not face the camera.

    Declaration

    Swift

    class GMSGroundOverlay : GMSOverlay

    Objective-C

    @interface GMSGroundOverlay : GMSOverlay
  • Describes a building which contains levels.

    Declaration

    Swift

    class GMSIndoorBuilding : NSObject

    Objective-C

    @interface GMSIndoorBuilding : NSObject
  • Provides ability to observe or control the display of indoor level data.

    Like GMSMapView, GMSIndoorDisplay may only be used from the main thread.

    Declaration

    Swift

    class GMSIndoorDisplay : NSObject

    Objective-C

    @interface GMSIndoorDisplay : NSObject
  • Describes a single level in a building.

    Multiple buildings can share a level - in this case the level instances will compare as equal, even though the level numbers/names may be different.

    Declaration

    Swift

    class GMSIndoorLevel : NSObject

    Objective-C

    @interface GMSIndoorLevel : NSObject
  • An opaque identifier for a custom map configuration.

    Declaration

    Swift

    class GMSMapID : NSObject, NSCopying

    Objective-C

    @interface GMSMapID : NSObject <NSCopying>
  • GMSMapLayer is a custom subclass of CALayer, provided as the layer class on GMSMapView. This layer should not be instantiated directly. It provides model access to the camera normally defined on GMSMapView.

    Modifying or animating these properties will typically interrupt any current gesture on GMSMapView, e.g., a user’s pan or rotation. Similarly, if a user performs an enabled gesture during an animation, the animation will stop ‘in-place’ (at the current presentation value).

    Declaration

    Swift

    class GMSMapLayer : GMSCALayer

    Objective-C

    @interface GMSMapLayer : GMSCALayer
  • GMSMapStyle holds details about a style which can be applied to a map.

    With style options you can customize the presentation of the standard Google map styles, changing the visual display of features like roads, parks, and other points of interest. As well as changing the style of these features, you can also hide features entirely. This means that you can emphasize particular components of the map or make the map complement the content of your app.

    For more information see: https://developers.google.com/maps/documentation/ios-sdk/styling

    Declaration

    Swift

    class GMSMapStyle : NSObject

    Objective-C

    @interface GMSMapStyle : NSObject
  • This is the main class of the Google Maps SDK for iOS and is the entry point for all methods related to the map.

    The map should be instantiated with one of the constructors -init or -initWithOptions:.

    GMSMapView can only be read and modified from the main thread, similar to all UIKit objects. Calling these methods from another thread will result in an exception or undefined behavior.

    Declaration

    Swift

    class GMSMapView : UIView

    Objective-C

    @interface GMSMapView : UIView
  • This class defines initialization-time options for GMSMapView.

    Declaration

    Swift

    class GMSMapViewOptions : NSObject

    Objective-C

    @interface GMSMapViewOptions : NSObject
  • A marker is an icon placed at a particular point on the map’s surface. A marker’s icon is drawn oriented against the device’s screen rather than the map’s surface; i.e., it will not necessarily change orientation due to map rotations, tilting, or zooming.

    Declaration

    Swift

    class GMSMarker : GMSOverlay

    Objective-C

    @interface GMSMarker : GMSOverlay
  • GMSMarkerLayer is a subclass of GMSOverlayLayer, available on a per-marker basis, that allows animation of several properties of its associated GMSMarker.

    Note that this CALayer is never actually rendered directly, as GMSMapView is provided entirely via an OpenGL layer. As such, adjustments or animations to ‘default’ properties of CALayer will not have any effect.

    Declaration

    Swift

    class GMSMarkerLayer : GMSOverlayLayer

    Objective-C

    @interface GMSMarkerLayer : GMSOverlayLayer
  • GMSMutablePath is a dynamic (resizable) array of CLLocationCoordinate2D. All coordinates must be valid. GMSMutablePath is the mutable counterpart to the immutable GMSPath.

    Declaration

    Swift

    class GMSMutablePath : GMSPath

    Objective-C

    @interface GMSMutablePath : GMSPath
  • GMSOverlay is an abstract class that represents some overlay that may be attached to a specific GMSMapView. It may not be instantiated directly; instead, instances of concrete overlay types should be created directly (such as GMSMarker, GMSPolyline, and GMSPolygon).

    This supports the NSCopying protocol; [overlay_ copy] will return a copy of the overlay type, but with map set to nil.

    Declaration

    Swift

    class GMSOverlay : NSObject, NSCopying

    Objective-C

    @interface GMSOverlay : NSObject <NSCopying>
  • GMSOverlayLayer is a custom subclass of CALayer, and an abstract baseclass for GMSOverlay layers that allow custom animations.

    Note that this CALayer or any subclass are never actually rendered directly, as GMSMapView is provided entirely via an OpenGL layer. As such, adjustments or animations to ‘default’ properties of CALayer will not have any effect.

    This is an implementation detail and it should not be instantiated directly.

    Declaration

    Swift

    class GMSOverlayLayer : CALayer

    Objective-C

    @interface GMSOverlayLayer : CALayer
  • GMSPanorama represents metadata for a specific panorama on the Earth. This class is not instantiable directly and is obtained via GMSPanoramaService or GMSPanoramaView.

    Declaration

    Swift

    class GMSPanorama : NSObject

    Objective-C

    @interface GMSPanorama : NSObject
  • GMSPanoramaCamera is used to control the viewing direction of a GMSPanoramaView. It does not contain information about which particular panorama should be displayed.

    Declaration

    Swift

    class GMSPanoramaCamera : NSObject

    Objective-C

    @interface GMSPanoramaCamera : NSObject
  • GMSPanoramaCameraUpdate represents an update that may be applied to a GMSPanoramaView. It encapsulates some logic for modifying the current camera. It should only be constructed using the factory helper methods below.

    Declaration

    Swift

    class GMSPanoramaCameraUpdate : NSObject

    Objective-C

    @interface GMSPanoramaCameraUpdate : NSObject
  • GMSPanoramaLayer is a custom subclass of CALayer, provided as the layer class on GMSPanoramaView. This layer should not be instantiated directly.

    Declaration

    Swift

    class GMSPanoramaLayer : GMSCALayer

    Objective-C

    @interface GMSPanoramaLayer : GMSCALayer
  • Links from a GMSPanorama to neighboring panoramas.

    Declaration

    Swift

    class GMSPanoramaLink : NSObject

    Objective-C

    @interface GMSPanoramaLink : NSObject
  • GMSPanoramaService can be used to request panorama metadata even when a GMSPanoramaView is not active.

    Get an instance like this: [[GMSPanoramaService alloc] init].

    Declaration

    Swift

    class GMSPanoramaService : NSObject

    Objective-C

    @interface GMSPanoramaService : NSObject
  • A panorama is used to display Street View imagery. It should be constructed via [[GMSPanoramaView alloc] initWithFrame:], and configured post-initialization.

    All properties and methods should be accessed on the main thread, similar to all UIKit objects. The GMSPanoramaViewDelegate methods will also be called back only on the main thread.

    The backgroundColor of this view is shown while no panorama is visible, such as while it is loading or if the panorama is later set to nil. The alpha color of backgroundColor is not supported.

    Declaration

    Swift

    class GMSPanoramaView : UIView

    Objective-C

    @interface GMSPanoramaView : UIView
  • GMSPath encapsulates an immutable array of CLLocationCooordinate2D. All the coordinates of a GMSPath must be valid. The mutable counterpart is GMSMutablePath.

    Declaration

    Swift

    class GMSPath : NSObject, NSCopying, NSMutableCopying

    Objective-C

    @interface GMSPath : NSObject <NSCopying, NSMutableCopying>
  • Provides a custom pin image for an advanced marker.

    Declaration

    Swift

    class GMSPinImage : UIImage

    Objective-C

    @interface GMSPinImage : UIImage
  • Provides a custom pin image glyph for an advanced marker.

    Declaration

    Swift

    class GMSPinImageGlyph : NSObject

    Objective-C

    @interface GMSPinImageGlyph : NSObject
  • Provides pin image customization for an advanced marker.

    Declaration

    Swift

    class GMSPinImageOptions : NSObject

    Objective-C

    @interface GMSPinImageOptions : NSObject
  • An interface representing a place feature (a feature with a Place ID).

    Declaration

    Swift

    class PlaceFeature : NSObject, Feature

    Objective-C

    
    @interface GMSPlaceFeature : NSObject <GMSFeature>
  • GMSPolygon defines a polygon that appears on the map. A polygon (like a polyline) defines a series of connected coordinates in an ordered sequence; additionally, polygons form a closed loop and define a filled region.

    Declaration

    Swift

    class GMSPolygon : GMSOverlay

    Objective-C

    @interface GMSPolygon : GMSOverlay
  • GMSPolygonLayer is a subclass of GMSOverlayLayer, available on a per-polygon basis, that allows animation of several properties of its associated GMSPolygon.

    Note that this CALayer is never actually rendered directly, as GMSMapView is provided entirely via an OpenGL layer. As such, adjustments or animations to ‘default’ properties of CALayer will not have any effect.

    Declaration

    Swift

    class GMSPolygonLayer : GMSOverlayLayer

    Objective-C

    @interface GMSPolygonLayer : GMSOverlayLayer
  • GMSPolyline specifies the available options for a polyline that exists on the Earth’s surface. It is drawn as a physical line between the points specified in path.

    Declaration

    Swift

    class GMSPolyline : GMSOverlay

    Objective-C

    @interface GMSPolyline : GMSOverlay
  • Defines a mapping between Earth coordinates CLLocationCoordinate2D and coordinates in the map’s view CGPoint. A projection is constant and immutable, in that the mapping it embodies never changes. The mapping is not necessarily linear.

    Passing invalid Earth coordinates (i.e., per CLLocationCoordinate2DIsValid) to this object may result in undefined behavior.

    This class should not be instantiated directly unless under testing conditions. Instead, obtain it via projection on GMSMapView.

    Declaration

    Swift

    class GMSProjection : NSObject

    Objective-C

    @interface GMSProjection : NSObject
  • Service class for the Google Maps SDK for iOS.

    This class is not thread safe. All methods should only be invoked on the main thread.

    Declaration

    Swift

    class GMSServices : NSObject

    Objective-C

    @interface GMSServices : NSObject
  • The abstract base class for polyline styles that draw a repeating image over a GMSStyleSpan.

    Declaration

    Swift

    class GMSStampStyle : NSObject

    Objective-C

    @interface GMSStampStyle : NSObject
  • A polyline style that draws a repeating image over a GMSStyleSpan.

    Declaration

    Swift

    class GMSTextureStyle : GMSStampStyle

    Objective-C

    @interface GMSTextureStyle : GMSStampStyle
  • Describes the drawing style for a stamp image over a GMSStyleSpan.

    Note

    Only supports transparent background. If any color is set to the GMSStyleSpan it will only be treated as a fallback.

    Note

    Use of GMSSpriteStyle requires Metal rendering framework. See GMSServices::setMetalRendererEnabled:(BOOL) to learn how to enable Metal. If GMSStyleSpan is added to a map without Metal being enabled, the stamp will not render and instead the polyline span will attempt to fallback to any set color. If no color is set, it will fallback to the default polyline color, [UIColor blueColor].

    Note

    Use GMSMapView::mapCapabilities property to query if a GMSMapView supports GMSSpriteStyle.

    Declaration

    Swift

    class GMSSpriteStyle : GMSStampStyle

    Objective-C

    @interface GMSSpriteStyle : GMSStampStyle
  • Describes the drawing style for one-dimensional entities such as polylines.

    Declaration

    Swift

    class GMSStrokeStyle : NSObject

    Objective-C

    @interface GMSStrokeStyle : NSObject
  • Describes the style for some region of a polyline.

    Declaration

    Swift

    class GMSStyleSpan : NSObject

    Objective-C

    @interface GMSStyleSpan : NSObject
  • GMSSyncTileLayer is an abstract subclass of GMSTileLayer that provides a sync interface to generate image tile data.

    Declaration

    Swift

    class GMSSyncTileLayer : GMSTileLayer

    Objective-C

    @interface GMSSyncTileLayer : GMSTileLayer
  • GMSTileLayer is an abstract class that allows overlaying of custom image tiles on a specified GMSMapView. It may not be initialized directly, and subclasses must implement the tileForX:y:zoom: method to return tiles.

    At zoom level 0 the whole world is a square covered by a single tile, and the coordinates x and y are both 0 for that tile. At zoom level 1, the world is covered by 4 tiles with x and y being 0 or 1, and so on.

    Declaration

    Swift

    class GMSTileLayer : NSObject

    Objective-C

    @interface GMSTileLayer : NSObject
  • Settings for the user interface of a GMSMapView.

    Declaration

    Swift

    class GMSUISettings : NSObject

    Objective-C

    @interface GMSUISettings : NSObject
  • GMSURLTileProvider fetches tiles based on the URLs returned from a GMSTileURLConstructor. For example:

       GMSTileURLConstructor constructor = ^(NSUInteger x, NSUInteger y, NSUInteger zoom) {
         NSString *URLStr =
             [NSString stringWithFormat:@"https://example.com/%d/%d/%d.png", x, y, zoom];
         return [NSURL URLWithString:URLStr];
       };
       GMSTileLayer *layer =
           [GMSURLTileLayer tileLayerWithURLConstructor:constructor];
       layer.userAgent = @"SDK user agent";
       layer.map = map;
     

    GMSURLTileProvider may not be subclassed and should only be created via its convenience constructor.

    Declaration

    Swift

    class GMSURLTileLayer : GMSTileLayer

    Objective-C

    @interface GMSURLTileLayer : GMSTileLayer