PWMapViewDelegate Protocol Reference

Conforms to MKMapViewDelegate
Declared in PWMapView.h

Overview

The PWMapViewDelegate protocol defines a set of optional methods that you can use to receive building-related update messages. Since many map operations require the PWMapView class to load data asynchronously, the map view calls these methods to notify your application when specific operations complete. PWMapViewDelegate inherits from MKMapViewDelegate.

– mapViewWillSetCamera:

Asks the delegate how the MKMapCamera will be set when the building is completely loaded.

- (MKMapCamera *)mapViewWillSetCamera:(PWMapView *)mapView

Parameters

mapView

The map view that started the load operation.

Return Value

The MKMapCamera that will be set when the building is completely loaded.

Discussion

This callback is optional; the SDK will set a appropriate camera to make the entire building fit the screen if it’s not implemented.

Declared In

PWMapView.h

– mapViewWillSetInitialFloor:

Asks the delegate for the PWFloor that will be displayed as the intial floor.

- (PWFloor *)mapViewWillSetInitialFloor:(PWMapView *)mapView

Parameters

mapView

The map view that started the load operation.

Return Value

The PWFloor that will be set as the initial floor.

Discussion

This callback is optional; the SDK will set the floor which has minimum level as intial floor if it’s not implemented.

Declared In

PWMapView.h

– mapView:didFinishLoadingBuilding:

Tells the delegate that the specified map view successfully loaded the necessary building data.

- (void)mapView:(PWMapView *)mapView didFinishLoadingBuilding:(PWBuilding *)building

Parameters

mapView

The map view that started the load operation.

building

The building that was loaded.

Discussion

This method is called when the building data has finished loading and is ready to be displayed on the map.

Declared In

PWMapView.h

– mapView:didFailToLoadBuilding:error:

Tells the delegate that the specified view was unable to load the building data.

- (void)mapView:(PWMapView *)mapView didFailToLoadBuilding:(PWBuilding *)building error:(NSError *)error

Parameters

mapView

The map view that started the load operation.

building

The building that the map view tried to load.

error

The reason that the map data could not be loaded.

Discussion

This method might be called in situations where the device does not have access to the network or is unable to load the building data. On a successful load, building data and assets are cached for future use.

Declared In

PWMapView.h

– mapView:didChangeFloor:

Tells the delegate that the specified map view successfully changed the building floor.

- (void)mapView:(PWMapView *)mapView didChangeFloor:(PWFloor *)floor

Parameters

mapView

The map view that changed the floor.

floor

The current floor displayed in the map view.

Discussion

This method is called when the floor data has finished loading and is ready to be displayed on the map.

Declared In

PWMapView.h

– mapView:didFailedToChangeFloor:error:

Tells the delegate that the specified map view failed to change the building floor.

- (void)mapView:(PWMapView *)mapView didFailedToChangeFloor:(PWFloor *)floor error:(NSError *)error

Parameters

mapView

The map view that attempted to change the floor.

floor

The floor that the map view attempted to change to.

error

The reason that the floor could not be loaded.

Declared In

PWMapView.h

– mapViewWillStartLocatingIndoorUser:

Tells the delegate that the map view will start tracking the user’s indoor location.

- (void)mapViewWillStartLocatingIndoorUser:(PWMapView *)mapView

Parameters

mapView

The map view tracking the user’s location.

Discussion

This method is called when the value of the showsIndoorUserLocation property changes to YES.

Declared In

PWMapView.h

– mapViewDidStopLocatingIndoorUser:

Tells the delegate that the map view stopped tracking the user’s indoor location.

- (void)mapViewDidStopLocatingIndoorUser:(PWMapView *)mapView

Parameters

mapView

The map view that stopped tracking the user’s indoor location.

Discussion

This method is called when the value of the showsIndoorUserLocation property changes to NO.

Declared In

PWMapView.h

– mapView:didFailToLocateIndoorUserWithError:

Tells the delegate that an attempt to locate the user’s position failed.

- (void)mapView:(PWMapView *)mapView didFailToLocateIndoorUserWithError:(NSError *)error

Parameters

mapView

The map view tracking the user’s indoor location.

error

An error object containing the reason why location acquisition failed.

Declared In

PWMapView.h

– mapView:locationManager:didUpdateIndoorUserLocation:

Tells the delegate that the indoor location of the user was updated.

- (void)mapView:(PWMapView *)mapView locationManager:(id<PWLocationManager>)locationManager didUpdateIndoorUserLocation:(PWUserLocation *)userLocation

Parameters

mapView

The map view tracking the user’s location.

locationManager

The location manager providing location updates.

userLocation

The location object representing the user’s latest location. This property may be nil.

Discussion

While the showsIndoorUserLocation property is set to YES, this method is called whenever a new location update is received by the map view.

Declared In

PWMapView.h

– mapViewStartedSnappingLocationToRoute:

Tells the delegate that the user’s location has been snapped to a route.

- (void)mapViewStartedSnappingLocationToRoute:(PWMapView *)mapView

Parameters

mapView

The map view snapping locations to a route.

Discussion

This method notifies the map view delegate that the map view has begun snapping user locations to a route.

Declared In

PWMapView.h

– mapViewStoppedSnappingLocationToRoute:

Tells the delegate that the user’s location was unsnapped from a route.

- (void)mapViewStoppedSnappingLocationToRoute:(PWMapView *)mapView

Parameters

mapView

The map view no longer snapping locations to a route.

Discussion

This method notifies the map view delegate that the map view has ceased snapping user locations to a route.

Declared In

PWMapView.h

– mapView:didChangeRouteInstruction:

Tells the delegate that the route instruction being highlighted has changed.

- (void)mapView:(PWMapView *)mapView didChangeRouteInstruction:(PWRouteInstruction *)instruction

Parameters

mapView

The map view reporting the step change.

instruction

The new instruction being highlighted on the map, or nil if it has been cleared.

Declared In

PWMapView.h

– mapViewShouldAnimateAutomaticRouteInstructionChange:

Asks the delegate whether the automatic route instruction change should be animated.

- (BOOL)mapViewShouldAnimateAutomaticRouteInstructionChange:(PWMapView *)mapView

Parameters

mapView

The map view asking whether or not to animate automatic route instruction changes.

Return Value

A Boolean value indicating whether or not to animate automatic route instruction changes.

Discussion

The automatic route instruction changes will be animated by default.

Declared In

PWMapView.h

– mapView:didChangeIndoorUserTrackingMode:

Tells the delegate that the map view’s user tracking mode was updated.

- (void)mapView:(PWMapView *)mapView didChangeIndoorUserTrackingMode:(PWTrackingMode)mode

Parameters

mapView

The map view with the altered user tracking mode.

mode

The mode used to track the user’s location.

Declared In

PWMapView.h

– mapViewShouldDisplayHeadingCalibration:

Asks the delegate whether the heading calibration display should be shown.

- (BOOL)mapViewShouldDisplayHeadingCalibration:(PWMapView *)mapView

Parameters

mapView

The map view asking whether or not to display the heading calibration.

Return Value

A Boolean value indicating whether or not the heading calibration should be displayed.

Discussion

The heading calibration will not be displayed by default.

Declared In

PWMapView.h

– mapView:didUpdateHeading:

Tells the delegate that the user’s heading has changed.

- (void)mapView:(PWMapView *)mapView didUpdateHeading:(CLHeading *)heading

Parameters

mapView

The map view reporting the change in user heading.

heading

The new heading value being reported.

Declared In

PWMapView.h

– mapView:viewForPointOfInterest:

Requests the view associated with the specified point-of-interest object.

- (MKAnnotationView *)mapView:(PWMapView *)mapView viewForPointOfInterest:(PWPointOfInterest *)poi

Parameters

mapView

The map view containing the annotation view.

poi

The object representing the point-of-interest that is about to be displayed.

Discussion

The same result as using mapView:viewForAnnotation:.

Declared In

PWMapView.h

– mapView:didAnnotateView:withPointOfInterest:

Tells the delegate that a point-of-interest view was added to the map.

- (void)mapView:(PWMapView *)mapView didAnnotateView:(PWBuildingAnnotationView *)view withPointOfInterest:(PWPointOfInterest *)poi

Parameters

mapView

The map view containing the annotation view.

view

The object representing the annotation that is about to be displayed.

poi

The object representing the point-of-interest that is about to be displayed.

Discussion

The same result as using mapView:didAddAnnotationViews:.

Declared In

PWMapView.h

– mapView:didAddBuildingAnnotationViews:

Tells the delegate that one or more annotation views were added to the map.

- (void)mapView:(PWMapView *)mapView didAddBuildingAnnotationViews:(NSArray<PWBuildingAnnotationView*> *)views

Parameters

mapView

The map view containing the annotation views.

views

An array of MKAnnotationView objects representing the views that were added.

Discussion

The same result as using mapView:didAddBuildingAnnotationViews:.

Declared In

PWMapView.h

– mapView:annotationView:calloutAccessoryControlTapped:withPointOfInterest:

Tells the delegate that the user tapped one of the point-of-interest view’s accessory buttons.

- (void)mapView:(PWMapView *)mapView annotationView:(PWBuildingAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control withPointOfInterest:(PWPointOfInterest *)poi

Parameters

mapView

The map view containing the annotation view.

view

The point-of-interest view whose button was tapped.

control

The visual elements that convey a specific action or intention in response to user interactions.

poi

The point-of-interest whose button was tapped.

Discussion

The same result as using mapView:calloutAccessoryControlTapped:.

Declared In

PWMapView.h

– mapView:didSelectBuildingAnnotationView:withPointOfInterest:

Tells the delegate that one of its annotation views was selected.

- (void)mapView:(PWMapView *)mapView didSelectBuildingAnnotationView:(PWBuildingAnnotationView *)view withPointOfInterest:(PWPointOfInterest *)poi

Parameters

mapView

The map view containing the annotation view.

view

The point-of-interest view that was selected.

poi

The point-of-interest that was selected.

Discussion

The same result by using mapView:didSelectAnnotationView:.

Declared In

PWMapView.h

– mapView:didDeselectBuildingAnnotationView:withPointOfInterest:

Tells the delegate that one of its annotation views was deselected.

- (void)mapView:(PWMapView *)mapView didDeselectBuildingAnnotationView:(PWBuildingAnnotationView *)view withPointOfInterest:(PWPointOfInterest *)poi

Parameters

mapView

The map view that requested the annotation view.

view

The point-of-interest view that was deselected.

poi

The point-of-interest that was deselected.

Discussion

The same result as using deselectAnnotations:animated:.

Declared In

PWMapView.h