MRMapViewController Class Reference

Inherits from UIViewController
Conforms to MRDSheetSearchDelegate
MRMapViewDelegate
Declared in MRMapViewController.h

Overview

A view controller implementing MRMapViewDelegate that handles all essential MRMapView tasks and events.

  mapView

The map view this controller is responsible for.

@property (nonatomic, strong) MRMapView *mapView

Declared In

MRMapViewController.h

  pendingDestination

If set, this controller will initiate directions to the specified destination as soon as the map view is displayed.

@property (nullable, nonatomic, strong) MRPlacemark *pendingDestination

Declared In

MRMapViewController.h

  sheetDelegate

Provides the data and actions related to the placemark annotation sheet.

@property (nullable, nonatomic, strong) id<MRDMapViewControllerDelegate> sheetDelegate

Declared In

MRMapViewController.h

  silenceNoRouteFoundAlerts

Allow for silencing no route found alerts. Default value is NO

@property (nonatomic, assign) BOOL silenceNoRouteFoundAlerts

Declared In

MRMapViewController.h

  shouldIndexAnnotations

Automatically index all placemarks after they’ve been loaded Default value is YES if disableCoreSpotlightIndexing is NO on your MRConfig Default value is YES if disableHapticFeedback is NO on your MRConfig

@property (nonatomic, assign) BOOL shouldIndexAnnotations

Declared In

MRMapViewController.h

  displaysSearchSheet

Always show a search card in the map view controller. Defaults to NO.

@property (nonatomic, assign) BOOL displaysSearchSheet

Declared In

MRMapViewController.h

  useAccessiblePathsDefault

Set the initial default route to be Accessible. Defaults to NO.

@property (nonatomic, assign) BOOL useAccessiblePathsDefault

Declared In

MRMapViewController.h

  persistentSheet

Set this to always show the provided sheet unless it’s displaying selected content or directions are active.

@property (nullable, nonatomic, strong) MRDBottomSheetAbstractController *persistentSheet

Declared In

MRMapViewController.h

– displaysSearchSheet:withQuickSearchPlacemarks:hideDefaultQuickSearchIcons:

Show a search card in the map view controller with optionally defined quick search placemarks.

- (void)displaysSearchSheet:(BOOL)displaysSearchSheet withQuickSearchPlacemarks:(NSArray<NSString*> *_Nullable)placemarkTypes hideDefaultQuickSearchIcons:(BOOL)hide

Parameters

displaysSearchSheet

If YES, the search card is always shown in the map view controller.

placemarkTypes

A list of placemark types (ex. conference_room) that will be shown as quick search placemarks in the search sheet. Quick search placemarks will only be shown if placemarks of the corresponding types exist at the location.

hide

If NO (the default), default quick search placemark types will be appended and shown in the search sheet.

Declared In

MRMapViewController.h

– initWithEditorKey:

A convenient initializer to add an associated editor key along with instantiation.

- (_Nullable instancetype)initWithEditorKey:(MREditorKey *)key

Parameters

key

An instance of MREditorKey

Return Value

An instance of a MRMapViewController

Declared In

MRMapViewController.h

– initWithEditorKey:isChildViewController:

A convenient initializer to add an associated editor key along with instantiation.

- (_Nullable instancetype)initWithEditorKey:(MREditorKey *)key isChildViewController:(BOOL)isChild

Parameters

key

An instance of MREditorKey

isChild

tells the view controller it should be treated as being inside a subview as a child view controller. This will manipulate the style of the sheet so it does not slide up from the bottom but appears over the subview itself.

Return Value

An instance of a MRMapViewController

Declared In

MRMapViewController.h

– initWithEditorKey:isChildViewController:placemarkID:

A convenient initializer to add an associated placemark id along with instantiation.

- (_Nullable instancetype)initWithEditorKey:(MREditorKey *)key isChildViewController:(BOOL)isChild placemarkID:(NSString *)placemarkID

Parameters

key

An instance of MREditorKey

isChild

tells the view controller it should be treated as being inside a subview as a child view controller. This will manipulate the style of the sheet so it does not slide up from the bottom but appears over the subview itself.

placemarkID

The id of the placemark to be selected on the map

Return Value

An instance of a MRMapViewController

Declared In

MRMapViewController.h

– startDirectionsToPlacemark:

Begins directions to the given Placemark from the user’s current location.

- (void)startDirectionsToPlacemark:(MRPlacemark *)placemark

Parameters

placemark

The destination for the route.

Declared In

MRMapViewController.h

– startDirectionsToFriend:

Begins directions to the given friend from the user’s current location.

- (void)startDirectionsToFriend:(MRFriend *)friend_

Parameters

friend_

The destination for the route.

Declared In

MRMapViewController.h

– startDirectionsToPlacemark:fromPlacemark:

Begins directions from one given Placemark to another.

- (void)startDirectionsToPlacemark:(MRPlacemark *)placemark fromPlacemark:(MRPlacemark *_Nullable)fromPlacemark

Parameters

placemark

The destination for the route.

fromPlacemark

The starting point for the route.

Declared In

MRMapViewController.h

– addSheetWithDetailController:animated:completion:

Adds a bottom sheet with the provided child as a child view controller. will remove any existing floating sheet. Uses sheetController’s isExpandable and isFloatable properties to determine sheet functionality.

- (void)addSheetWithDetailController:(MRDBottomSheetAbstractController *)sheetController animated:(BOOL)animated completion:(nullable MRAddSheetCompletion)completion

Parameters

sheetController

child view controller that will reside within the bottom sheet

animated

Should the sheet removal be animated.

completion

Called after the sheet is shown. If the sheet is not shown, nil is passed to the completion block.

Declared In

MRMapViewController.h

– removeSheet:completion:

Removes any sheet managed by MRMapViewController.

- (void)removeSheet:(BOOL)animated completion:(void ( ^ __nullable ) ( void ))completion

Parameters

animated

Should the sheet removal be animated.

completion

Called after the viewController is removed from the view hierarchy. It’s called immediately if there’s no bottom sheet to remove.

Declared In

MRMapViewController.h

– zoomToAnnotation:

Zooms the map view to the selected annotation.

- (void)zoomToAnnotation:(id<MRAnnotation>)annotation

Parameters

annotation

An annotation target.

Declared In

MRMapViewController.h

– showAnnotationsInBottomSheet:

In an MRDBottomSheetViewController, shows the provided annotations in a list.

- (void)showAnnotationsInBottomSheet:(NSArray<MRAnnotation> *)annotations

Parameters

annotations

Annotations to show in the bottom sheet.

Declared In

MRMapViewController.h

– shouldReplaceSheet:with:

Called after addSheetWithDetailController:animated:completion is called and MRMapViewController is showing a bottom sheet view controller.

- (BOOL)shouldReplaceSheet:(MRDBottomSheetAbstractController *)currentSheetController with:(MRDBottomSheetAbstractController *)incomingSheetController

Parameters

currentSheetController

The sheet currently being displayed by the map view controller.

incomingSheetController

The sheet that would replace the currentSheetController if this method returns YES.

Return Value

whether incoming should replace current. If YES, currentSheetController is replaced by incomingSheetController. If NO, nothing happens.

Declared In

MRMapViewController.h