# GMTCMapView

    @interface GMTCMapView : GMSMapView

This class represents the main view in the Consumer SDK for iOS.
You can use this class to create a customizable map so that your users can
use the `consumerMapStylecoordinator` to create custom markers and polylines.

Note: You should instantiate this map via the default constructor `[[GMTCMapView alloc]
initWithFrame:]`.

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


  ### [delegate](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(py)delegate)


  ` Delegate of the map view.

  #### Declaration

  Swift

      weak var delegate: (any https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewDelegate.html)? { get set }

  Objective-C

      @property (nonatomic, weak, nullable) id<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewDelegate.html> delegate;

- `


  ### [consumerMapStyleCoordinator](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(py)consumerMapStyleCoordinator)


  ` Maintains customizable UI options for the library's markers, polylines, and polygons.

  #### Declaration

  Swift

      var consumerMapStyleCoordinator: https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCConsumerMapStyleCoordinator.html { get }

  Objective-C

      @property (nonatomic, readonly) https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCConsumerMapStyleCoordinator.html *_Nonnull consumerMapStyleCoordinator;

- `


  ### [allowCameraAutoUpdate](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(py)allowCameraAutoUpdate)


  ` Allows the map view's camera to auto-update. The default value is YES.

  #### Declaration

  Swift

      var isAllowCameraAutoUpdate: Bool { get set }

  Objective-C

      @property (nonatomic, assign, unsafe_unretained, readwrite,
                getter=isAllowCameraAutoUpdate) BOOL allowCameraAutoUpdate;

- `


  ### [-initWithOptions:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(im)initWithOptions:)


  ` Creates a new map view with the given options. The value of the options object is copied by this
  method.

  #### Declaration

  Swift

      init(options: GMSMapViewOptions)

  Objective-C

      - (nonnull instancetype)initWithOptions:(nonnull GMSMapViewOptions *)options;

- `


  ### [-initWithFrame:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(im)initWithFrame:)


  ` Deprecated

  Use `-initWithOptions` instead.
  Initialization of the `GMTCMapView` object.

  #### Declaration

  Swift

      init(frame: CGRect)

  Objective-C

      - (nonnull instancetype)initWithFrame:(CGRect)frame;

- `


  ### [-initWithCoder:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(im)initWithCoder:)


  ` Deprecated

  Use `-initWithOptions` instead.
  Initialization with coder.

  #### Declaration

  Swift

      init?(coder aDecoder: NSCoder)

  Objective-C

      - (nullable instancetype)initWithCoder:(nonnull NSCoder *)aDecoder;

- `


  ### [-resetCamera](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(im)resetCamera)


  ` Resets the mapView's camera to the default position based on the current active mapView
  session(s).

  #### Declaration

  Swift

      func resetCamera()

  Objective-C

      - (void)resetCamera;

- `


  ### [-redrawRidesharingOverlays](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(im)redrawRidesharingOverlays)


  ` Forces a redraw of all the overlays for ridesharing that were rendered in the current map view.
  These overlays include the ridesharing related markers referenced by `https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Enums/GMTCCustomizableMarkerType.html`
  , the polygons for pickup compounded area and trip routes. You can use this method to redraw
  overlays cleaned by calling `clear` on `GMTCMapView`. Note: This API does not restore the
  overlays added from an application layer.

  #### Declaration

  Swift

      func redrawRidesharingOverlays()

  Objective-C

      - (void)redrawRidesharingOverlays;

- `


  ### [-showMapViewSession:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(im)showMapViewSession:)


  ` Shows a mapView session on the mapView.

  #### Declaration

  Swift

      func show(_ session: any https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSession.html)

  Objective-C

      - (void)showMapViewSession:(nonnull id<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSession.html>)session;

- `


  ### [-hideMapViewSession:](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(im)hideMapViewSession:)


  ` Hides a mapView session on the mapView.

  #### Declaration

  Swift

      func hide(_ session: any https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSession.html)

  Objective-C

      - (void)hideMapViewSession:(nonnull id<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSession.html>)session;

- `


  ### [-hideAllMapViewSessions](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(im)hideAllMapViewSessions)


  ` Hide all the mapView sessions on the mapView.

  #### Declaration

  Swift

      func hideAllMapViewSessions()

  Objective-C

      - (void)hideAllMapViewSessions;

- `


  ### [-activeSessions](https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Classes/GMTCMapView#/c:objc(cs)GMTCMapView(im)activeSessions)


  ` Returns all the mapView sessions currently shown on the mapView.

  #### Declaration

  Swift

      func activeSessions() -> [any https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSession.html]

  Objective-C

      - (nonnull NSArray<id<https://developers.google.com/maps/documentation/mobility/journey-sharing/on-demand/reference/ios/Protocols/GMTCMapViewSession.html>> *)activeSessions;