SYMapCamera Class Reference

A UIView subclass used by an application to display a map. More...

#import <SYMapCamera.h>

Inheritance diagram for SYMapCamera:
Collaboration diagram for SYMapCamera:

Instance Methods

(SYTransformCenterSettings- transformCenterSettings
 Get map transform center settings. More...
 
(CGPoint) - transformCenter
 Get actual transform center. More...
 
(SYAnimationId) - rotateView:withDuration:curve:completion:
 Rotate current view camera by offset in degrees. More...
 
(SYAnimationId) - dragView:withDuration:curve:completion:
 Drag current view camera by offset in screen points. More...
 
(SYAnimationId) - dragViewFrom:to:withDuration:curve:completion:
 Drag current view camera from one screen point to another screen point. More...
 
(SYAnimationId) - zoomView:atPoint:withDuration:curve:completion:
 Zoom current view camera by scale. More...
 
(SYAnimationId) - setViewBoundingBox:withEdgeInsets:duration:curve:completion:
 Transforms the map to fit an arbitrary geo bounding box. More...
 
(SYAnimationId) - setViewBoundingBox:withEdgeInsets:maxZoomLevel:duration:curve:completion:
 Transforms the map to fit an arbitrary geo bounding box. More...
 
(void) - setTransformCenterSettings:withDuration:curve:
 Set map transform center point and animation properties. More...
 
(void) - setRotationOffset:withDuration:curve:
 Set map camera rotation offset with animation. More...
 
(void) - setTranslationOffset:withDuration:curve:
 Set map camera translation offset with animation. More...
 
(SYAnimationId) - animate:withDuration:curve:completion:
 Animate map view properties. More...
 
(void) - cancelAnimationWithId:
 Cancel animation. More...
 
(void) - cancelAllAnimations
 Cancel all animations. More...
 
(nonnull SYCameraProperties *) - calculateCameraPropertiesForBoundingBox:transformCenter:rotation:tilt:maxZoomLevel:edgeInsets:
 Calculates camera properties to make reqested area visible with given parameters. More...
 

Properties

id< SYMapCameraDelegatedelegate
 SYMapCameraDelegate delegate. More...
 
SYGeoCoordinategeoCenter
 The SYGeoCoordinates corresponding to the current screen position of the transformCenter. More...
 
CGFloat zoom
 Current view zoom level. The zoom level determines how "close" the map view is to the surface of the Earth. Higher zoom levels give a closer view. Zoom 1 is the view on the earth, zoom 10 is approximately view on city, 15 on street, etc. More...
 
SYAngle rotation
 The current view rotation,in a range of degrees between [0..360). By default,the map is oriented with north toward the top of the map (0 degrees). As the orientation angle increases,the map rotates counter-clockwise so that at 90 degrees. More...
 
SYAngle tilt
 Current view tilt in degrees <0,80> The tilt controls the perspective at which the map is viewed. A value of 0 degrees corresponds to looking straight down at the map from above (2D). As the tilt value is increased,the view shifts to a 3D perspective. More...
 
SYCameraMovement movementMode
 Represents the camera movement mode. Take a look at the available SYCameraMovementModes. More...
 
SYCameraRotation rotationMode
 Represents the camera rotation behaviour. Take a look at the available SYCameraRotationModes. More...
 
SYGeoBoundingBoxboundingBox
 The SYGeoBoundingBox representing the current screen area of the SYMapView. More...
 
SYCameraRotationOffset rotationOffset
 Setting this property will rotate camera around its axes. With default 0,0,0 rotation offset, camera is looking directly at SYMapView.geoCenter point. More...
 
SYCameraTranslationOffset translationOffset
 Camera translation from its origin point. More...
 
BOOL isMoving
 YES if map is changing its position, NO otherwise. More...
 

Detailed Description

A UIView subclass used by an application to display a map.

Method Documentation

◆ transformCenterSettings

- (SYTransformCenterSettings) transformCenterSettings

Get map transform center settings.

◆ transformCenter

- (CGPoint) transformCenter

Get actual transform center.

◆ rotateView:withDuration:curve:completion:

- (SYAnimationId) rotateView: (SYAngle)  angle
withDuration: (NSTimeInterval)  duration
curve: (SYMapAnimationCurve)  curve
completion: (nullable SYAnimationCompletionBlock)  completion 

Rotate current view camera by offset in degrees.

Parameters
angleCamera rotation offset in degrees.
durationAnimation duration.
curveAnimation curve.
completionAnimation completion block.
Returns
Animation identifier. SYAnimationNone if animation param is nil or no animation was started.

◆ dragView:withDuration:curve:completion:

- (SYAnimationId) dragView: (CGPoint)  drag
withDuration: (NSTimeInterval)  duration
curve: (SYMapAnimationCurve)  curve
completion: (nullable SYAnimationCompletionBlock)  completion 

Drag current view camera by offset in screen points.

Parameters
dragCamera move offset in screen points.
durationAnimation duration.
curveAnimation curve.
completionAnimation completion block.
Returns
Animation identifier. SYAnimationNone if animation param is nil or no animation was started.

◆ dragViewFrom:to:withDuration:curve:completion:

- (SYAnimationId) dragViewFrom: (CGPoint)  from
to: (CGPoint)  to
withDuration: (NSTimeInterval)  duration
curve: (SYMapAnimationCurve)  curve
completion: (nullable SYAnimationCompletionBlock)  completion 

Drag current view camera from one screen point to another screen point.

Parameters
fromScreen from point.
toScreen to point.
durationAnimation duration.
curveAnimation curve.
completionAnimation completion block.
Returns
Animation identifier. SYAnimationNone if animation param is nil or no animation was started.

◆ zoomView:atPoint:withDuration:curve:completion:

- (SYAnimationId) zoomView: (CGFloat)  scale
atPoint: (CGPoint)  center
withDuration: (NSTimeInterval)  duration
curve: (SYMapAnimationCurve)  curve
completion: (nullable SYAnimationCompletionBlock)  completion 

Zoom current view camera by scale.

Parameters
scaleZoom scale.
centerScreen point to zoom at. Usually represents center of pinch gesture toches. Ignored if SYMapView.cameraMovementMode is not SYCameraMovementFree.
durationAnimation duration.
curveAnimation curve.
completionAnimation completion block.
Returns
Animation identifier. SYAnimationNone if animation param is nil or no animation was started.

◆ setViewBoundingBox:withEdgeInsets:duration:curve:completion:

- (SYAnimationId) setViewBoundingBox: (nonnull SYGeoBoundingBox *)  boundingBox
withEdgeInsets: (UIEdgeInsets)  edgeInsets
duration: (NSTimeInterval)  duration
curve: (SYMapAnimationCurve)  curve
completion: (nullable SYAnimationCompletionBlock)  completion 

Transforms the map to fit an arbitrary geo bounding box.

Parameters
boundingBoxSYGeoBoundingBox to show.
edgeInsetsEdge insets in relative screen coordinates <0,1>.
durationAnimation duration.
curveAnimation curve.
completionAnimation completion block.
Returns
Animation identifier. SYAnimationNone if animation param is nil or no animation was started.

◆ setViewBoundingBox:withEdgeInsets:maxZoomLevel:duration:curve:completion:

- (SYAnimationId) setViewBoundingBox: (nonnull SYGeoBoundingBox *)  boundingBox
withEdgeInsets: (UIEdgeInsets)  edgeInsets
maxZoomLevel: (CGFloat)  maxZoom
duration: (NSTimeInterval)  duration
curve: (SYMapAnimationCurve)  curve
completion: (nullable SYAnimationCompletionBlock)  completion 

Transforms the map to fit an arbitrary geo bounding box.

Parameters
boundingBoxSYGeoBoundingBox to show.
edgeInsetsEdge insets in relative screen coordinates <0,1>.
maxZoomMaximal zoom level of the resulting view (0,20>.
durationAnimation duration.
curveAnimation curve.
completionAnimation completion block.
Returns
Animation identifier. SYAnimationNone if animation param is nil or no animation was started.

◆ setTransformCenterSettings:withDuration:curve:

- (void) setTransformCenterSettings: (SYTransformCenterSettings settings
withDuration: (NSTimeInterval)  duration
curve: (SYMapAnimationCurve)  curve 

Set map transform center point and animation properties.

◆ setRotationOffset:withDuration:curve:

- (void) setRotationOffset: (SYCameraRotationOffset offset
withDuration: (NSTimeInterval)  duration
curve: (SYMapAnimationCurve)  curve 

Set map camera rotation offset with animation.

◆ setTranslationOffset:withDuration:curve:

- (void) setTranslationOffset: (SYCameraTranslationOffset offset
withDuration: (NSTimeInterval)  duration
curve: (SYMapAnimationCurve)  curve 

Set map camera translation offset with animation.

◆ animate:withDuration:curve:completion:

- (SYAnimationId) animate: (nonnull void(^)(void))  animations
withDuration: (NSTimeInterval)  duration
curve: (SYMapAnimationCurve)  curve
completion: (nullable SYAnimationCompletionBlock)  completion 

Animate map view properties.

Parameters
animationsAnimation block containing properties changes. Animable properties are geoCenter, rotation, tilt and zoom. @duration Animation duration.
curveAnimation curve.
completionAnimation completion block.
Returns
Animation id.

◆ cancelAnimationWithId:

- (void) cancelAnimationWithId: (SYAnimationId)  animation

Cancel animation.

◆ cancelAllAnimations

- (void) cancelAllAnimations

Cancel all animations.

◆ calculateCameraPropertiesForBoundingBox:transformCenter:rotation:tilt:maxZoomLevel:edgeInsets:

- (nonnull SYCameraProperties*) calculateCameraPropertiesForBoundingBox: (nonnull SYGeoBoundingBox *)  boundingBox
transformCenter: (CGPoint)  transformCenter
rotation: (CGFloat)  rotation
tilt: (CGFloat)  tilt
maxZoomLevel: (CGFloat)  maxZoom
edgeInsets: (UIEdgeInsets)  edgeInsets 

Calculates camera properties to make reqested area visible with given parameters.

Parameters
boundingBoxBoundingBox to display on map.
transformCenterRequested transform center.
rotationRequested rotation.
tiltRequested tilt.
maxZoomMaximum zoom level.
edgeInsetsEdge insets in relative screen coordinates <0,1>.

Property Documentation

◆ delegate

- (id<SYMapCameraDelegate>) delegate
readwritenonatomicweak

◆ geoCenter

- (SYGeoCoordinate*) geoCenter
readwritenonatomicstrong

The SYGeoCoordinates corresponding to the current screen position of the transformCenter.

◆ zoom

- (CGFloat) zoom
readwritenonatomicassign

Current view zoom level. The zoom level determines how "close" the map view is to the surface of the Earth. Higher zoom levels give a closer view. Zoom 1 is the view on the earth, zoom 10 is approximately view on city, 15 on street, etc.

◆ rotation

- (SYAngle) rotation
readwritenonatomicassign

The current view rotation,in a range of degrees between [0..360). By default,the map is oriented with north toward the top of the map (0 degrees). As the orientation angle increases,the map rotates counter-clockwise so that at 90 degrees.

◆ tilt

- (SYAngle) tilt
readwritenonatomicassign

Current view tilt in degrees <0,80> The tilt controls the perspective at which the map is viewed. A value of 0 degrees corresponds to looking straight down at the map from above (2D). As the tilt value is increased,the view shifts to a 3D perspective.

The tilt of the map may be further constrained at some zoom levels. For example,no tilt is allowed at the lowest zoom levels when the globe is visible. This is to provide a better user experience when interacting with globe,since viewing a "tilted" globe does give any benefit.

◆ movementMode

- (SYCameraMovement) movementMode
readwritenonatomicassign

Represents the camera movement mode. Take a look at the available SYCameraMovementModes.

◆ rotationMode

- (SYCameraRotation) rotationMode
readwritenonatomicassign

Represents the camera rotation behaviour. Take a look at the available SYCameraRotationModes.

◆ boundingBox

- (SYGeoBoundingBox*) boundingBox
readwritenonatomicstrong

The SYGeoBoundingBox representing the current screen area of the SYMapView.

◆ rotationOffset

- (SYCameraRotationOffset) rotationOffset
readwritenonatomicassign

Setting this property will rotate camera around its axes. With default 0,0,0 rotation offset, camera is looking directly at SYMapView.geoCenter point.

◆ translationOffset

- (SYCameraTranslationOffset) translationOffset
readwritenonatomicassign

Camera translation from its origin point.

◆ isMoving

- (BOOL) isMoving
readnonatomicassign

YES if map is changing its position, NO otherwise.


The documentation for this class was generated from the following file: