NSDK_UIMapView

@interface NSDK_UIMapView : GLKView <UIGestureRecognizerDelegate>

This is the class for rendering maps and showing them on the screen.

@author PTV AG Karlsruhe

  • Undocumented

    Declaration

    Objective-C

    - (void)refresh;

    Swift

    func refresh()
  • Sets the center position of the MapView.

    Declaration

    Objective-C

    - (void)setCenterWithPosition:(NSDK_Position *)position;

    Swift

    func setCenterWith(_ position: NSDK_Position!)

    Parameters

    position

    the center position of the MapView (Mercator)

  • Sets the center position of the MapView.

    Declaration

    Objective-C

    - (void)setCenterWithGeoPosition:(NSDK_GeoPosition *)geoposition;

    Swift

    func setCenterWith(_ geoposition: NSDK_GeoPosition!)

    Parameters

    geoposition

    the center position of the MapView

  • Position a marker indicating the current position on the map.

    Declaration

    Objective-C

    - (void)setMapMarkerWithCenter:(NSDK_Position *)mapMarkerCenter
                       orientation:(int)orientation
                    northernAdjust:(BOOL)northernAdjust
                             style:(NSDK_MapMarkerStyle)mapMarkerStyle;

    Swift

    func setMapMarkerWithCenter(_ mapMarkerCenter: NSDK_Position!, orientation: Int32, northernAdjust: Bool, style mapMarkerStyle: NSDK_MapMarkerStyle)

    Parameters

    mapMarkerCenter

    The coordinates of the center (Mercator)

    orientation

    Defines the orientation of the marker (if suitable). The valus is given in degree clockwise, 0 represents top.

    northernAdjust

    if set to YES the orientation is ignored and the marker is always directed towards the top of the map.

    mapMarkerStyle

    Defines which kind marker is being drawn, see NSDK_MapMarkerStyle

  • Sets the scale of the current MapView.

    The scaling factor is a multiple of mercator units per pixel.

    Declaration

    Objective-C

    - (void)setScale:(int)scale;

    Swift

    func setScale(_ scale: Int32)

    Parameters

    scale

    the scale of the current MapView.

  • Gets the scale of the current MapView.

    The scaling factor is a multiple of mercator units per pixel.

    Declaration

    Objective-C

    - (int)getScale;

    Swift

    func getScale() -> Int32

    Return Value

    the scale of the current MapView

  • Translate the map by the given pixel amount

    Declaration

    Objective-C

    - (void)translateMapByx:(int)x y:(int)y;

    Swift

    func translateMapByx(_ x: Int32, y: Int32)

    Parameters

    x

    x coordinate translation

    y

    y coordinate translation

  • Rotates the map by amount of degrees

    Declaration

    Objective-C

    - (void)rotateMapBy:(CGFloat)rotation;

    Swift

    func rotateMap(by rotation: CGFloat)

    Parameters

    rotation

    the rotation in degrees. Positive values rotate the map clockwise, negative values counterclockwise

  • Rotates the map by amount of radians

    Declaration

    Objective-C

    - (void)rotateMapByRadians:(CGFloat)rotation;

    Swift

    func rotateMap(byRadians rotation: CGFloat)

    Parameters

    rotation

    the rotation in radians. Positive values rotate the map clockwise, negative values counterclockwise

  • zoom to the current route trace

    Declaration

    Objective-C

    - (void)zoom2Route:(NSError **)error;

    Swift

    func zoom2Route(_ error: NSErrorPointer)
  • zoom to the current route trace

    Declaration

    Objective-C

    - (void)zoom2RouteWithTranslatex:(int)translateX
                                   y:(int)translateY
                             routeId:(int)id
                               error:(NSError **)error;

    Swift

    func zoom2Route(withTranslatex translateX: Int32, y translateY: Int32, routeId id: Int32, error: NSErrorPointer)

    Parameters

    translateX

    translate the map x pixels afterwards

    translateY

    translate the map y pixels afterwards

    id

    route id

  • sets the map colors for the current map

    Declaration

    Objective-C

    - (void)setMapDesign:(NSString *)filename isDay:(BOOL)isDay;

    Swift

    func setMapDesign(_ filename: String!, isDay: Bool)

    Parameters

    filename

    the complete path with filename of the file which contains the map colors (must be included in the iOS App Bundle)

    isDay

    determines if the design is for day or night mode

  • Transforms coordinates from source format to the specified destination format

    Declaration

    Objective-C

    - (NSDK_Position *)
    transformCoordinatesWithSourceFormat:(NSDK_CoordinateSystem)sourceFormat
                          sourcePosition:(NSDK_Position *)source
                       destinationFormat:(NSDK_CoordinateSystem)destinationFormat
                                   error:(NSError **)error;

    Swift

    func transformCoordinates(withSourceFormat sourceFormat: NSDK_CoordinateSystem, sourcePosition source: NSDK_Position!, destinationFormat: NSDK_CoordinateSystem, error: NSErrorPointer) -> NSDK_Position!

    Parameters

    sourceFormat

    The enum value of the source format (see NSDK_CoordinateSystem). This can be a pixel value of the actual Mapview or specific coordinates (geodecimal, mercator).

    source

    X The input coordinate to transform.

    destinationFormat

    The enum value of the destination format of the transformation.

    Return Value

    the transformed coordinates.

  • Gets the orientation/rotation of the map.

    Declaration

    Objective-C

    - (int)getOrientation:(NSError **)error;

    Swift

    func getOrientation(_ error: NSErrorPointer) -> Int32

    Return Value

    the orientation/rotation of the map

  • Sets the orientation/rotation of the map.

    Declaration

    Objective-C

    - (void)setOrientation:(int)orientation;

    Swift

    func setOrientation(_ orientation: Int32)
  • Undocumented

    Declaration

    Objective-C

    - (void) NS_SWIFT_NOTHROW doAutoZoom:(NSDK_NavigationInformation*) navInfo  gpsData:(NSDK_GPSData*) gpsData doSmoothZoom:(BOOL) doSmoothZoom error:(NSError**) error;

    Swift

    func doAutoZoom(_ navInfo: NSDK_NavigationInformation!, gpsData: NSDK_GPSData!, doSmoothZoom: Bool, error: NSErrorPointer)
  • Adjust the fix point of the Map view.

    Declaration

    Objective-C

    - (void)setFixPoint:(NSDK_Position *)position;

    Swift

    func setFixPoint(_ position: NSDK_Position!)

    Parameters

    position

    Relative position in percent of the screen pixel width counting from the center (e.g. to move left[right], use -1[1] to -99[99]).

  • Called before the map is drawn Overwrite this method or use NSDK_OnInitializeListener if you want to implement your own behaviour

    Declaration

    Objective-C

    - (void)onInitialized;

    Swift

    func onInitialized()
  • Undocumented

    Declaration

    Objective-C

    - (void) setOnInitializeListener:(id<NSDK_OnInitializeListener>) listener;

    Swift

    func setOnInitializeListener(_ listener: NSDK_OnInitializeListener!)
  • Undocumented

    Declaration

    Objective-C

    - (void) removeOnInitializeListener;

    Swift

    func removeOnInitializeListener()
  • Sets whether the map is 3d or 2d mode.

    Declaration

    Objective-C

    - (void)set3dMode:(BOOL)is3d;

    Swift

    func set3dMode(_ is3d: Bool)

    Parameters

    is3d

    whether the map is 3d or 2d mode

  • Get whether the map is 3d or 2d mode.

    Declaration

    Objective-C

    - (BOOL)get3dMode;

    Swift

    func get3dMode() -> Bool

    Return Value

    whether the map is 3d or 2d mode

  • Add a polyline to the internal rendering data.

    Declaration

    Objective-C

    - (int)addTraceWithBeforeRouteTrace:(Boolean)beforeRouteTrace
                             polyPoints:(NSArray<NSDK_Position *> *)positions
                             innerColor:(NSDK_Color *)innerColor
                             outerColor:(NSDK_Color *)outerColor
                              lineStyle:(int)lineStyle
                              lineWidth:(int)lineWidth
                                  error:(NSError **)error;

    Swift

    func addTraceWith(beforeRouteTrace: Bool, polyPoints positions: [NSDK_Position]!, innerColor: NSDK_Color!, outerColor: NSDK_Color!, lineStyle: Int32, lineWidth: Int32, error: NSErrorPointer) -> Int32

    Parameters

    beforeRouteTrace

    if YES polyline will be drawn before route trace (if any), else afterwards (e.g. on top).

    positions

    non-NULL pointer to route trace.

    innerColor

    Color for the inner of the trace.

    outerColor

    Color for the onner of the trace.

    lineStyle

    unsupported

    lineWidth

    If >0 it is the absolute size in pixel. For 2d maps that one is constant all over the output, for 3d it is of course scaled according to the projection. Negative values are interpreted as an increment by the absolute, i.e. positive, value on top of the maximum street width.

    error

    contains error information, if an error occured

    Return Value

    will be set trace ID to be used for further requests to that object, e.g. calls to removeTrace()

  • Remove trace from rendering

    Declaration

    Objective-C

    - (void)removeTrace:(int)traceId error:(NSError **)error;

    Swift

    func removeTrace(_ traceId: Int32, error: NSErrorPointer)

    Parameters

    traceId

    trace id as obtained by addTraceWithBeforeRouteTrace: to be deleted. Use negative values to remove all traces added via addTraceWithBeforeRouteTrace: to the given Mapview.

    error

    contains error information, if an error occured

  • Zoom to the given trace Important: Works only in 2D and not in 3D mode

    Declaration

    Objective-C

    - (BOOL)zoom2Trace:(int)traceId
            translateX:(int)translateX
            translateY:(int)translateY;

    Swift

    func zoom2Trace(_ traceId: Int32, translateX: Int32, translateY: Int32) -> Bool

    Parameters

    traceId

    trace id as obtained by addTraceWithBeforeRouteTrace:

    translateX

    translate the map x pixels afterwards

    translateY

    translate the map y pixels afterwards

  • Adjust the visual appearance of traces.

    Adjust the visual appearance of some generic trace types, including route and TMC traces.

    Declaration

    Objective-C

    - (void)setStandardTraceParametersWithLineWidth:(int)lineWidth
                                         innerColor:(NSDK_Color *)innerColor
                                         outerColor:(NSDK_Color *)outerColor
                                            traceId:(int)traceId
                                              error:(NSError **)error;

    Swift

    func setStandardTraceParametersWithLineWidth(_ lineWidth: Int32, innerColor: NSDK_Color!, outerColor: NSDK_Color!, traceId: Int32, error: NSErrorPointer)

    Parameters

    lineWidth

    the absolute size in pixel. For 2d maps that one is constant all over the output, for 3d it is of course scaled according to the projection.

    innerColor

    Color for the inner of the trace.

    outerColor

    Color for the outer of the trace.

    traceId

    the value 1 specifies the route trace, greater IDs specify TMC and/or custom traces. Values lower than 1 are ignored.

    error

    contains error information, if an error occured

  • Sets whether the map should be drawn in grayscale colors.

    Declaration

    Objective-C

    - (void)setGrayMode:(BOOL)grayMode error:(NSError **)error;

    Swift

    func setGrayMode(_ grayMode: Bool, error: NSErrorPointer)

    Parameters

    grayMode

    whether the map should be drawn in grayscale colors

    error

    contains error information, if an error occured

  • Gets whether the map should be drawn in grayscale colors.

    Declaration

    Objective-C

    - (BOOL)getGrayMode:(NSError **)error;

    Swift

    func getGrayMode(_ error: NSErrorPointer) -> Bool

    Parameters

    error

    contains error information, if an error occured

    Return Value

    whether the map should be drawn in grayscale colors

  • Sets whether the map should be drawn in night mode colors.

    Declaration

    Objective-C

    - (void)setNightMode:(BOOL)nightMode error:(NSError **)error;

    Swift

    func setNightMode(_ nightMode: Bool, error: NSErrorPointer)

    Parameters

    nightMode

    whether the map should be drawn in night mode colors

    error

    contains error information, if an error occured

  • Gets whether the map should be drawn in night mode colors.

    Declaration

    Objective-C

    - (BOOL)getNightMode:(NSError **)error;

    Swift

    func getNightMode(_ error: NSErrorPointer) -> Bool

    Parameters

    error

    contains error information, if an error occured

    Return Value

    whether the map should be drawn in night mode colors

  • Retrieve the brightness of the MapView.

    Declaration

    Objective-C

    - (int)getBrightness:(NSError **)error;

    Swift

    func getBrightness(_ error: NSErrorPointer) -> Int32

    Parameters

    error

    contains error information, if an error occured

    Return Value

    a Number between 0 (dark) and 100 (bright, day)

  • Sets the brightness of the MapView.

    Declaration

    Objective-C

    - (void)setBrightness:(int)brightness error:(NSError **)error;

    Swift

    func setBrightness(_ brightness: Int32, error: NSErrorPointer)

    Parameters

    brightness

    pBrightness A number between 0 (dark) and 100 (bright, day)

    error

    contains error information, if an error occured

  • Retrieves the style of the marker.

    Declaration

    Objective-C

    - (NSDK_MapMarkerStyle)getMapMarkerStyle:(NSError **)error;

    Swift

    func getMapMarkerStyle(_ error: NSErrorPointer) -> NSDK_MapMarkerStyle

    Parameters

    error

    contains error information, if an error occured

    Return Value

    the style of the marker.

  • Returns true, if orientation is ignored and the marker is always directed towards the top of the map.

    Declaration

    Objective-C

    - (BOOL)getMapMarkerNorthernAdjusted:(NSError **)error;

    Swift

    func getMapMarkerNorthernAdjusted(_ error: NSErrorPointer) -> Bool

    Parameters

    error

    contains error information, if an error occured

    Return Value

    true, if orientation is ignored and the marker is always directed towards the top of the map. Else false.

  • Retrieves the orientation of the marker (if suitable). The valus is given in degree clockwise, 0 represents top.

    Declaration

    Objective-C

    - (int)getMapMarkerOrientation:(NSError **)error;

    Swift

    func getMapMarkerOrientation(_ error: NSErrorPointer) -> Int32

    Parameters

    error

    contains error information, if an error occured

    Return Value

    the orientation of the marker (and -1 in case of an error occured).

  • Retrieves the coordinates of the center.

    Declaration

    Objective-C

    - (NSDK_Position *)getMapMarkerCenter:(NSError **)error;

    Swift

    func getMapMarkerCenter(_ error: NSErrorPointer) -> NSDK_Position!

    Parameters

    error

    contains error information, if an error occured

    Return Value

    the coordinates of the center.

  • Get the fix point of the Map view

    Declaration

    Objective-C

    - (NSDK_Position *)getFixPoint:(NSError **)error;

    Swift

    func getFixPoint(_ error: NSErrorPointer) -> NSDK_Position!

    Parameters

    error

    contains error information, if an error occured

    Return Value

    the fix point of the Map view

  • Get the current background color of the mapview

    Declaration

    Objective-C

    - (int)getBackgroundColor:(NSError **)error;

    Swift

    func getBackgroundColor(_ error: NSErrorPointer) -> Int32

    Parameters

    error

    contains error information, if an error occured

    Return Value

    the current background color of the mapview