On-demand Rides and Deliveries Solution is currently available only to select partners. Contact sales to learn more.

GMTCMapView Class Reference


Overview

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.

Public Member Functions

(instancetype) - initWithFrame:
 Initialization of the GMTCMapView object.
(nullable instancetype) - initWithCoder:
 Initialization with coder.
(instancetype) - initWithFrame:camera:
 Initialization of the GMTCMapView object, which falls back to initWithFrame.
(instancetype) - initWithFrame:mapID:camera:
 Initialization of the GMTCMapView object, which falls back to initWithFrame.
(void) - resetCamera
 Resets the mapView's camera to the default position based on the current active mapView session(s).
(void) - redrawRidesharingOverlays
 Forces a redraw of all the overlays for ridesharing that were rendered in the current map view.
(void) - showMapViewSession:
 Shows a mapView session on the mapView.
(void) - hideMapViewSession:
 Hides a mapView session on the mapView.
(void) - hideAllMapViewSessions
 Hide all the mapView sessions on the mapView.
(NSArray< id
< GMTCMapViewSession >> *) 
- activeSessions
 Returns all the mapView sessions currently shown on the mapView.

Static Public Member Functions

(instancetype) + mapWithFrame:camera:
 Builds and returns a map view with a frame and camera target, which falls back to initWithFrame.

Properties

id< GMTCMapViewDelegatedelegate
 Delegate of the map view.
GMTCConsumerMapStyleCoordinatorconsumerMapStyleCoordinator
 Maintains customizable UI options for the library's markers, polylines, and polygons.
BOOL allowCameraAutoUpdate
 Allows the map view's camera to auto-update.

Member Function Documentation

- (instancetype) initWithFrame: (CGRect)  frame

Initialization of the GMTCMapView object.

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

Initialization with coder.

- (instancetype) initWithFrame: (CGRect)  frame
camera: (GMSCameraPosition *)  camera 

Initialization of the GMTCMapView object, which falls back to initWithFrame.

The camera parameter is ignored.

Note:
Use -initWithFrame instead.
- (instancetype) initWithFrame: (CGRect)  frame
mapID: (GMSMapID *)  mapID
camera: (GMSCameraPosition *)  camera 

Initialization of the GMTCMapView object, which falls back to initWithFrame.

The mapID and camera parameters are ignored.

Note:
Use -initWithFrame instead.
+ (instancetype) mapWithFrame: (CGRect)  frame
camera: (GMSCameraPosition *)  camera 

Builds and returns a map view with a frame and camera target, which falls back to initWithFrame.

The camera parameter is ignored.

Note:
Use -initWithFrame instead.
- (void) resetCamera

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

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 GMTCCustomizableMarkerType, 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.
- (void) showMapViewSession: (id< GMTCMapViewSession >)  session

Shows a mapView session on the mapView.

- (void) hideMapViewSession: (id< GMTCMapViewSession >)  session

Hides a mapView session on the mapView.

Hide all the mapView sessions on the mapView.

- (NSArray<id<GMTCMapViewSession>> *) activeSessions

Returns all the mapView sessions currently shown on the mapView.


Property Documentation

- (id<GMTCMapViewDelegate>) delegate [read, write, assign]

Delegate of the map view.

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

- (BOOL) allowCameraAutoUpdate [read, write, assign]

Allows the map view's camera to auto-update.

The default value is YES.