GoogleRidesharingConsumer Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMTCMapViewDelegate
@protocol GMTCMapViewDelegate <GMSMapViewDelegate>
Delegate for events on GMTCMapView
.
-
Called after the mapVIew initialization completes and the mapView is ready to render a mapView
session.
Declaration
Swift
optional func mapViewDidInitialize(_ mapview: GMTCMapView)
Objective-C
- (void)mapViewDidInitialize:(nonnull GMTCMapView *)mapview;
Parameters
mapview
|
The GMTCMapView that generated the event.
|
-
Called after user tapped on the marker.
Declaration
Swift
optional func mapView(_ mapView: GMSMapView, didTapConsumerMarker mapMarker: GMSMarker, markerType: GMTCMapViewMarkerType) -> Bool
Objective-C
- (BOOL)mapView:(nonnull GMSMapView *)mapView
didTapConsumerMarker:(nonnull GMSMarker *)mapMarker
markerType:(GMTCMapViewMarkerType)markerType;
Parameters
mapView
|
The GMTCMapView that generated the event.
|
mapMarker
|
|
markerType
|
The type of the tapped marker.
|
Return Value
YES if this delegate handled the tap event, which prevents the map from performing its
default selection behavior, and NO if the map should continue with its default selection
behavior.
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\u003eGMTCMapViewDelegate\u003c/code\u003e is a protocol that handles events on a \u003ccode\u003eGMTCMapView\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003emapViewDidInitialize:\u003c/code\u003e method is called when the \u003ccode\u003emapView\u003c/code\u003e initialization is complete and ready for rendering.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003emapView:didTapConsumerMarker:markerType:\u003c/code\u003e method is called when a user taps on a marker, providing details about the tapped marker and allowing the delegate to handle the tap event.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003emapView:didTapConsumerMarker:markerType:\u003c/code\u003e method returns a boolean value to determine if the tap should carry on with default behavior.\u003c/p\u003e\n"]]],[],null,["# GoogleRidesharingConsumer Framework Reference\n\nGMTCMapViewDelegate\n===================\n\n @protocol GMTCMapViewDelegate \u003cGMSMapViewDelegate\u003e\n\nDelegate for events on [GMTCMapView](../Classes/GMTCMapView.html).\n- `\n ``\n ``\n `\n\n ### [-mapViewDidInitialize:](#/c:objc(pl)GMTCMapViewDelegate(im)mapViewDidInitialize:)\n\n `\n ` \n Called after the mapVIew initialization completes and the mapView is ready to render a mapView\n session. \n\n #### Declaration\n\n Swift \n\n optional func mapViewDidInitialize(_ mapview: ../Classes/GMTCMapView.html)\n\n Objective-C \n\n - (void)mapViewDidInitialize:(nonnull ../Classes/GMTCMapView.html *)mapview;\n\n #### Parameters\n\n |-----------------|-------------------------------------------|\n | ` `*mapview*` ` | The GMTCMapView that generated the event. |\n\n- `\n ``\n ``\n `\n\n ### [-mapView:didTapConsumerMarker:markerType:](#/c:objc(pl)GMTCMapViewDelegate(im)mapView:didTapConsumerMarker:markerType:)\n\n `\n ` \n Called after user tapped on the marker. \n\n #### Declaration\n\n Swift \n\n optional func mapView(_ mapView: GMSMapView, didTapConsumerMarker mapMarker: GMSMarker, markerType: ../Enums/GMTCMapViewMarkerType.html) -\u003e Bool\n\n Objective-C \n\n - (BOOL)mapView:(nonnull GMSMapView *)mapView\n didTapConsumerMarker:(nonnull GMSMarker *)mapMarker\n markerType:(../Enums/GMTCMapViewMarkerType.html)markerType;\n\n #### Parameters\n\n |--------------------|-------------------------------------------|\n | ` `*mapView*` ` | The GMTCMapView that generated the event. |\n | ` `*mapMarker*` ` | The user tapped marker. |\n | ` `*markerType*` ` | The type of the tapped marker. |\n\n #### Return Value\n\n YES if this delegate handled the tap event, which prevents the map from performing its\n default selection behavior, and NO if the map should continue with its default selection\n behavior."]]