MEMapView Class Reference

Inherits from GLKView
Conforms to UIGestureRecognizerDelegate
Declared in MEMapView.h

Overview

MEMapView displays maps, annotations and other content, and handles gestures (panning, zooming, scrolling, tapping) perfomed by the user.

Other Methods

+ forceLink

TBD

+ (void)forceLink

Declared In

MEMapView.h

  name

A simple convenience property for keeping track of multiple views.

@property (atomic, retain) NSString *name

Declared In

MEMapView.h

  meMapViewDelegate

The an optional delegate that will receive map-related update messages

@property (nonatomic, assign) id<MEMapViewDelegate> meMapViewDelegate

Declared In

MEMapView.h

Tile Selection

  tilePointSize

The device independent point width and height for map tiles. The default is 380.0.

@property (nonatomic, assign) double tilePointSize

Declared In

MEMapView.h

  tilePixelSize

The device dependent pixel width and height for a map tile.

@property (nonatomic, readonly) unsigned int tilePixelSize

Declared In

MEMapView.h

  tileLevelBias

When set to 1.0, the mapping engine will force all levels to be coherent. In other words, if you have a raster street map, you can force it to always display a consistent. This results in more work for the engine and increased tile counts being displayed. Sometimes this can have a drastic impact on performance at certain viewing angles and distances. This should always be set to 0.0 when possible.

@property (nonatomic, assign) double tileLevelBias

Declared In

MEMapView.h

  tileBiasSmoothingEnabled

When tileLevelBias is greater than zero, setting this to YES limits level bias flip-flopping with smooth camera motion. NOTE: Enabling this setting can result in potentially more tiles being loaded for virtual maps than are necessary for the current camera position.

@property (nonatomic, assign) BOOL tileBiasSmoothingEnabled

Declared In

MEMapView.h

Gesture Recognition

  panVelocityScale

Scales the velocity of panning gestures up or down. Default is 1.0. If you increase this value, the user’s gestures velocities will be multiplied by this value. Consider adjusting the panAcceleration before changing this value.

@property (nonatomic, assign) double panVelocityScale

Declared In

MEMapView.h

  meMapViewController

The MEMapViewController that is driving this view.

@property (nonatomic, assign) MEMapViewController *meMapViewController

Declared In

MEMapView.h

  panGestureRecognizer

TBD

@property (nonatomic, readonly, retain) UIPanGestureRecognizer *panGestureRecognizer

Declared In

MEMapView.h

  isPanDecelerationEnabled

If set to YES, enables pan deceleration, othersie pan deceleration is disabled. Defaults to YES.

@property (nonatomic, assign, getter=isPanDecelerationEnabled) BOOL isPanDecelerationEnabled

Declared In

MEMapView.h

  panAcceleration

Controls the rate at which a panning gesture’s velocity slows down once the user finishes the gesture. The default value is -10.0. If you increase this value, it has the affect of giving more momentum to panning gestures. If you set this value to 0, panning gestures will create a motion that will not stop and just continue.

@property (nonatomic, assign) double panAcceleration

Declared In

MEMapView.h

  clearColor

The color displayed when the screen is cleared with prior to drawing the map.

@property (nonatomic, retain) UIColor *clearColor

Declared In

MEMapView.h

  minimumZoom

Sets the minimum distance in meters from the camera/viewer to the map

@property (nonatomic, assign) double minimumZoom

Declared In

MEMapView.h

  maximumZoom

Sets the maximum distance in meters from the camera/viewer to the map

@property (nonatomic, assign) double maximumZoom

Declared In

MEMapView.h

  panEnabled

If set to YES, the view can be panned, otherwise it panning is disabled. Defaults to YES.

@property (nonatomic, getter=isPanEnabled) BOOL panEnabled

Declared In

MEMapView.h

  zoomEnabled

If set to YES, the view can be zoomed, otherwise it zooming is disabled. Defaults to YES.

@property (nonatomic, getter=isZoomEnabled) BOOL zoomEnabled

Declared In

MEMapView.h

– zoomIn

Zoom in to the center of the screen

- (void)zoomIn

Declared In

MEMapView.h

– zoomOut

Zoom in from the center of the screen

- (void)zoomOut

Declared In

MEMapView.h

– pointValueToPixelValue:

TBD

- (double)pointValueToPixelValue:(CGFloat)pointValue

Declared In

MEMapView.h

– panGestureHandler:

TBD

- (IBAction)panGestureHandler:(UIGestureRecognizer *)sender

Declared In

MEMapView.h

– tapGestureAtPoint:

Force tap getures handling at point

- (void)tapGestureAtPoint:(CGPoint)point

Declared In

MEMapView.h

Placement - New

  defaultAnimationDuration

The amount of time in seconds to animate placement changes (location, altitude, orientation).

@property (nonatomic, assign) double defaultAnimationDuration

Declared In

MEMapView.h

  location

The geographic location at the center of the view.

@property (nonatomic, assign) CLLocationCoordinate2D location

Declared In

MEMapView.h

– setLocation:animationDuration:

Sets the geographic location smoothly over a period of time.

- (void)setLocation:(CLLocationCoordinate2D)newLocation animationDuration:(CGFloat)animationDuration

Declared In

MEMapView.h

– setLocation3D:animationDuration:

Sets the geographic location smoothly over a period of time.

- (void)setLocation3D:(MELocation3D)newLocation animationDuration:(CGFloat)animationDuration

Declared In

MEMapView.h

  altitude

The altitude above sea level in meters.

@property (nonatomic, assign) double altitude

Declared In

MEMapView.h

– setAltitude:animationDuration:

Sets the altitude smoothly over a period of time.

- (void)setAltitude:(CGFloat)newAltitude animationDuration:(CGFloat)animationDuration

Declared In

MEMapView.h

  heading

Heading in degrees.

@property (nonatomic, assign) double heading

Declared In

MEMapView.h

– setHeading:animationDuration:

Sets the heading smoothly over a period of time.

- (void)setHeading:(CGFloat)newHeading animationDuration:(CGFloat)animationDuration

Declared In

MEMapView.h

  roll

Roll in degrees.

@property (nonatomic, assign) double roll

Declared In

MEMapView.h

– setRoll:animationDuration:

Sets the roll smoothly over a period of time.

- (void)setRoll:(CGFloat)newRoll animationDuration:(CGFloat)animationDuration

Declared In

MEMapView.h

  pitch

Pitch in degrees.

@property (nonatomic, assign) double pitch

Declared In

MEMapView.h

– setPitch:animationDuration:

Sets the pitch smoothly over a period of time.

- (void)setPitch:(CGFloat)newPitch animationDuration:(CGFloat)animationDuration

Declared In

MEMapView.h

  cameraPlacement

Provides a convenient way to read or set all camera placement attributes.

@property (nonatomic, retain) MECameraPlacement *cameraPlacement

Declared In

MEMapView.h

  meCameraConstraintDelegate

Set to something you create that implementes the methods of the MECameraConstraintDelegate interface to respond to camera location changes. Set to nil to disable.

@property (nonatomic, retain) id<MECameraConstraintDelegate> meCameraConstraintDelegate

Declared In

MEMapView.h

– convertCoordinate:

Converts a geographic coordinate to a screen positiion.

- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate

Declared In

MEMapView.h

– convertCoordinate3D:

Converts a geographic coordinate to a screen positiion.

- (CGPoint)convertCoordinate3D:(MELocation3D)coordinate

Declared In

MEMapView.h

– lookAtCoordinate:andCoordinate:withHorizontalBuffer:withVerticalBuffer:animationDuration:

Fit two points in view with some space (buffer) between the two points and the view edge.

- (void)lookAtCoordinate:(CLLocationCoordinate2D)coordinate1 andCoordinate:(CLLocationCoordinate2D)coordinate2 withHorizontalBuffer:(double)horizontalBufferInPoints withVerticalBuffer:(double)verticalBufferInPoints animationDuration:(CGFloat)animationDuration

Declared In

MEMapView.h

– location3DThatFitsBounds:withHorizontalBuffer:withVerticalBuffer:

Compute a 3D location from which two points (SW point, NE point) would be in view. Useful for looking at an area of interest.

- (MELocation3D)location3DThatFitsBounds:(MELocationBounds)bounds withHorizontalBuffer:(double)horizontalBufferInPoints withVerticalBuffer:(double)verticalBufferInPoints

Declared In

MEMapView.h

– location3DThatFitsPoints:withHorizontalBuffer:withVerticalBuffer:

Compute a 3D location form which an array of points would be in view. Useful for looking at a route.

- (MELocation3D)location3DThatFitsPoints:(NSArray *)points withHorizontalBuffer:(double)horizontalBufferInPoints withVerticalBuffer:(double)verticalBufferInPoints

Declared In

MEMapView.h

– setCameraOrientation:roll:pitch:animationDuration:

Sets the orientation of the camera.

- (void)setCameraOrientation:(CGFloat)heading roll:(CGFloat)roll pitch:(CGFloat)pitch animationDuration:(CGFloat)animationDuration

Parameters

heading

Number of degrees away from true north

roll

Number of degrees to roll away from vertical

pitch

Number of degrees to look up above the horizon

animationDuration

The duration in seconds to animate to this orientation from the previous orientation

Declared In

MEMapView.h

– setCameraPlacement:animationDuration:

Sets the location and orientation of the camera

- (void)setCameraPlacement:(MECameraPlacement *)cameraPlacement animationDuration:(CGFloat)animationDuration

Parameters

animationDuration

The duration in seconds to animate to this position from the previous position

Declared In

MEMapView.h

Dealing with Points and Screen Coordinates

  deviceScale

The scaling factor used to convert points to pixels. This value is computed when the render target size changes. Until there is a valid render target (i.e. the engine is initialized and there is an OpenGL surface available) this value may be 0.

@property (readonly) CGFloat deviceScale

Declared In

MEMapView.h

  deviceScaleOverride

If set to greater than 0, overrides the computed device scale. If you are sending cached marker images, or vector style assets to the mapping engine prior to the availability the actual OpenGL render target, you may need to override the deviceScale (which defaults to 1.0). Depending on how your application operates and on which platforms, this may be necessary to do, espeically on the iPhone 6 and higher since the device scale can often be different than the UIMainScreen scale.

@property (assign) CGFloat deviceScaleOverride

Declared In

MEMapView.h

– convertPoint:

Converts a screen position to a geographic coordinate.

- (CLLocationCoordinate2D)convertPoint:(CGPoint)point

Declared In

MEMapView.h

– distanceToHorizonFromPoint:

Returns a normalized (0 to 1) value indicating how the given screen coordinate relates to the horizon of the sphere. The value approaches 0 at the horizon and is 0 beyond the horizon. The value approaches the farther away from the horizon the point it. A value of 1.0 would be a point in the ‘center’ of the sphere equidistant from the horizon in all directions. A value less than 1.0 and greater than 0.0 is approaching the horizon. A value of 0.0 means the point is beyond the horizon.

- (double)distanceToHorizonFromPoint:(CGPoint)point

Declared In

MEMapView.h

– encodeCoordinate:

Wraps a CLLocationCoordinate2D in an NSValue. See also decodeCoodrinate.

- (NSValue *)encodeCoordinate:(CLLocationCoordinate2D)clLocation

Declared In

MEMapView.h

– decodeCoordinate:

Unwraps a CLLocationCoordinate2D from an NSValue. See also encodeCoodrinate.

- (CLLocationCoordinate2D)decodeCoordinate:(NSValue *)valueWrappedCoordinate

Declared In

MEMapView.h

– addSubscriber:

TBD

- (void)addSubscriber:(MEMapView *)subscriber

Declared In

MEMapView.h

– clearSubscribers

TBD

- (void)clearSubscribers

Declared In

MEMapView.h