TGMapViewDelegate
@protocol TGMapViewDelegate <NSObject>
A map view delegate can receive various map events.
Note
All of these methods are called from main thread, these methods are all optional.-
Receive the result from
-[TGMapView pickFeatureAt:].Declaration
Objective-C
- (void)mapView:(nonnull TGMapView *)mapView didSelectFeature:(nullable TGFeatureProperties *)feature atScreenPosition:(CGPoint)position;Swift
optional func mapView(_ mapView: TGMapView, didSelectFeature feature: [String : String]?, atScreenPosition position: CGPoint)Parameters
mapViewThe map view instance.
featureA dictionary of properties of the picked feature or
nilif no feature was found.positionThe view position where the feature was picked.
-
Receive the result from
-[TGMapView pickLabelAt:].Declaration
Objective-C
- (void)mapView:(nonnull TGMapView *)mapView didSelectLabel:(nullable TGLabelPickResult *)labelPickResult atScreenPosition:(CGPoint)position;Swift
optional func mapView(_ mapView: TGMapView, didSelectLabel labelPickResult: TGLabelPickResult?, atScreenPosition position: CGPoint)Parameters
mapViewThe map view instance.
labelPickResultA result object with information about the picked label or
nilif no label was found.positionThe view position where the label was picked.
-
Receive the result from
-[TGMapView pickMarkerAt:].Declaration
Objective-C
- (void)mapView:(nonnull TGMapView *)mapView didSelectMarker:(nullable TGMarkerPickResult *)markerPickResult atScreenPosition:(CGPoint)position;Swift
optional func mapView(_ mapView: TGMapView, didSelectMarker markerPickResult: TGMarkerPickResult?, atScreenPosition position: CGPoint)Parameters
mapViewThe map view instance.
markerPickResultA result object with information about the picked marker or
nilif no marker was found.positionThe view position where the marker was picked.
-
Receive the result from
-[TGMapView captureScreenshot:].Declaration
Objective-C
- (void)mapView:(nonnull TGMapView *)mapView didCaptureScreenshot:(nonnull UIImage *)screenshot;Swift
optional func mapView(_ mapView: TGMapView, didCaptureScreenshot screenshot: UIImage)Parameters
mapViewThe map view instance.
screenshotThe image object representing the screenshot.
-
Called after a scene has been loaded or updated.
See:
-[TGMapView loadSceneAsyncFromURL:withUpdates:]-[TGMapView loadSceneFromYAML:relativeToURL:withUpdates:]-[TGMapView loadSceneAsyncFromYAML:relativeToURL:withUpdates:]-[TGMapView updateSceneAsync:]Declaration
Objective-C
- (void)mapView:(nonnull TGMapView *)mapView didLoadScene:(int)sceneID withError:(nullable NSError *)sceneError;Swift
optional func mapView(_ mapView: TGMapView, didLoadScene sceneID: Int32, withError sceneError: Error?)Parameters
mapViewThe map view instance.
sceneIDThe ID of the scene that was loaded or updated.
sceneErrorAny error encountered while loading or updating the scene.
-
Called immediately before the displayed map region moves.
Declaration
Objective-C
- (void)mapView:(nonnull TGMapView *)mapView regionWillChangeAnimated:(BOOL)animated;Swift
optional func mapView(_ mapView: TGMapView, regionWillChangeAnimated animated: Bool)Parameters
mapViewThe map view instance.
animatedIf YES the move will be animated over time, if NO the move will happen immediately.
-
Called after the displayed map region moves.
Declaration
Objective-C
- (void)mapView:(nonnull TGMapView *)mapView regionDidChangeAnimated:(BOOL)animated;Swift
optional func mapView(_ mapView: TGMapView, regionDidChangeAnimated animated: Bool)Parameters
mapViewThe map view instance.
animatedIf YES the move was animated over time, if NO the move happened immediately.
View on GitHub
TGMapViewDelegate Protocol Reference
