NTMapView
@interface NTMapView : GLKView
MapView is a view class supporting map rendering and interaction.
-
Undocumented
Declaration
Objective-C
@property (readonly, assign, nonatomic) void* nativeMapViewPtr
Swift
var nativeMapViewPtr: UnsafeMutableRawPointer! { get }
-
Undocumented
Declaration
Objective-C
-(id)init;
Swift
init!()
-
Undocumented
Declaration
Objective-C
-(id)initWithCoder:(NSCoder *)aDecoder;
Swift
init!(coder aDecoder: NSCoder!)
-
Undocumented
Declaration
Objective-C
-(id)initWithFrame:(CGRect)frame;
Swift
init!(frame: CGRect)
-
Registers the SDK license. This is class method and must be called before
creating any actual MapView instances.Declaration
Objective-C
+ (BOOL)registerLicense:(NSString *)licenseKey;
Swift
class func registerLicense(_ licenseKey: String!) -> Bool
Parameters
licenseKey
The license string provided for this application.
-
Returns the map rotation in degrees. 0 means looking north, 90 means west, -90 means east and 180 means south.
Declaration
Objective-C
- (float)getBearing;
Swift
func getBearing() -> Float
Return Value
The map rotation in degrees in range of (-180 .. 180].
-
Returns the tilt angle in degrees. 0 means looking directly at the horizon, 90 means looking directly down.
Declaration
Objective-C
- (float)getTilt;
Swift
func getTilt() -> Float
Return Value
The tilt angle in degrees.
-
Returns the zoom level. The value returned is never negative, 0 means absolutely zoomed out and all other values describe some level of zoom.
Declaration
Objective-C
- (float)getZoom;
Swift
func getZoom() -> Float
Return Value
The zoom level.
-
Sets the new absolute focus position. The new focus position is expected to be in the coordinate system of the base projection. The new focus position will be clamped to the world bounds and to the bounds set by Options::setPanBounds.
If durationSeconds > 0 the panning operation will be animated over time. If the previous panning animation has not finished by the time this method is called, it will be stopped.
Declaration
Objective-C
- (void)setFocalPointPosition:(NTLngLat *)pos durationSeconds:(float)durationSeconds;
Swift
func setFocalPointPosition(_ pos: NTLngLat!, durationSeconds: Float)
Parameters
pos
The new focus point position in base coordinate system.
durationSeconds
The duration in which the tilting operation will be completed in seconds.
-
Sets the new absolute rotation value. 0 means look north, 90 means west, -90 means east and 180 means south. The rotation value will be wrapped to the range of (-180 .. 180]. Rotations are ignored if Options::setRotatable is set to false.
If durationSeconds > 0 the rotating operation will be animated over time. If the previous rotating animation has not finished by the time this method is called, it will be stopped.
Declaration
Objective-C
- (void)setBearing:(float)angle durationSeconds:(float)durationSeconds;
Swift
func setBearing(_ angle: Float, durationSeconds: Float)
Parameters
angle
The new absolute rotation angle value in degrees.
durationSeconds
The duration in which the zooming operation will be completed in seconds.
-
Sets the new absolute tilt value. 0 means look directly at the horizon, 90 means look directly down. The minimum tilt angle is 30 degrees and the maximum is 90 degrees. The tilt value can be further constrained by the Options::setTiltRange method. Values exceeding these ranges will be clamped.
If durationSeconds > 0 the tilting operation will be animated over time. If the previous tilting animation has not finished by the time this method is called, it will be stopped.
Declaration
Objective-C
- (void)setTilt:(float)tilt durationSeconds:(float)durationSeconds;
Swift
func setTilt(_ tilt: Float, durationSeconds: Float)
Parameters
tilt
The new absolute tilt value in degrees.
durationSeconds
The duration in which the tilting operation will be completed in seconds.
-
Sets the new absolute zoom value. The minimum zoom value is 0, which means absolutely zoomed out and the maximum zoom value is 24. The zoom value can be further constrained by the Options::setZoomRange method. Values exceeding these ranges will be clamped.
If durationSeconds > 0 the zooming operation will be animated over time. If the previous zooming animation has not finished by the time this method is called, it will be stopped.
Declaration
Objective-C
- (void)setZoom:(float)zoom durationSeconds:(float)durationSeconds;
Swift
func setZoom(_ zoom: Float, durationSeconds: Float)
Parameters
zoom
The new absolute zoom value.
durationSeconds
The duration in which the zooming operation will be completed in seconds.
-
Animate the view parameters (focus position, tilt, rotation, zoom) so that the specified bounding box becomes fully visible. This method does not work before the screen size is set.
Declaration
Objective-C
- (void)moveToCameraBounds:(NTBounds *)bounds viewportBounds:(NTViewportBounds *)viewportBounds integerZoom:(BOOL)integerZoom durationSeconds:(float)durationSeconds;
Swift
func move(toCameraBounds bounds: NTBounds!, viewportBounds: NTViewportBounds!, integerZoom: Bool, durationSeconds: Float)
Parameters
mapBounds
The bounding box on the map to be made visible in the base projection’s coordinate system.
screenBounds
The screen bounding box where to fit the map bounding box.
integerZoom
If true, then closest integer zoom level will be used. If false, exact fractional zoom level will be used.
durationSeconds
The duration in which the operation will be completed in seconds.
-
Returns the map event listener. May be null.
Declaration
Objective-C
- (NTMapEventListener *)getMapEventListener;
Swift
func getMapEventListener() -> NTMapEventListener!
Return Value
The map event listener.
-
Sets the map event listener. If a null pointer is passed no map events will be generated. The default is null.
Declaration
Objective-C
- (void)setMapEventListener:(NTMapEventListener *)mapEventListener;
Swift
func setMapEventListener(_ mapEventListener: NTMapEventListener!)
Parameters
mapEventListener
The new map event listener.