Navigation SDK Documentation |
Functions to control the mapviews.
Initializes a new Mapview (only under Windows)
Attention: This method works only under Windows (not UWP) with a given HWND!
An application can contain more than one MapView. This allows to show multiple maps in one application. The MapViews are independent from each other. This means they can show different sections of a map at the same time. MapViews have to be released by calling SDK_ReleaseMapView()! Note that MapViews are also memory consuming (a multiple of the amount required just for the internal bitmap representation. So watch the memory footprint and avoid creating too many unused MapViews.
[in] | WndHandle | The Window Handle of the object the Mapview is displayed on. To offer all functionality the object must be capable of receiving and sending MouseEvents. |
[out] | pHandle | A mapview id (>=0) or value < in case of error |
SDK_ERROR SDK_API SDK_InitMapViewFB | ( | SDK_UINT2 * | pixelData, |
SDK_UINT2 | width, | ||
SDK_UINT2 | height, | ||
SDK_BOOL | upsideDown, | ||
SDK_INT4 * | pHandle | ||
) |
Initializes a new Mapview with frame buffer.
This method initializes a map view and uses the given buffer as the render target. It is independent of the underlying windows system and works on all supported platforms.
Instead of using a window handle like SDK_InitMapView, this version takes a pixel buffer to render the map to. For each pixel, the buffer must contain 2 bytes. The color encoding is 5/6/5 RGB. E.g. if you want a map of size 640x480 you need to allocate a pixel buffer of size 640*480*2 bytes.
Attention: The buffer width and so the width parameter of the function must be a multiple of two to avoid distortions while rendering!
A sample code snippet to initialize the map view would be:
set the internal width of the buffer to a multiple of 2 which is needed by the internal renderer if ((mWidth % 2) != 0) mWidth–;
SDK_INT4 handle; mBuffer = new uchar[mWidth * mHeight * 2]; SDK_InitMapViewFB(mBuffer, mWidth, mHeight, SDK_TRUE, &handle);
The caller has to take care to free the buffer and realloc it when the mapview size should change or when the mapview will be released.
Changing the size is done by freeing and reallocing the buffer to the new size, sending the command SDK_SendMapViewEvent() with parameter SDK_wmSize and the resized buffer along with the new width and height of the buffer.
An application can contain more than one MapView. This allows to show multiple maps in one application. The MapViews are independent from each other. This means they can show different sections of a map at the same time.
MapViews have to be released by calling SDK_ReleaseMapView()! Note that MapViews are also memory consuming (a multiple of the amount required just for the internal bitmap representation). So watch the memory footprint and avoid creating too many unused MapViews.
[in] | pixelData | The pixel buffer used for rendering the map to. |
[in] | width | The width of the pixel buffer. |
[in] | height | The height of the pixel buffer. |
[in] | upsideDown | Change vertical rendering direction |
[out] | pHandle | A mapview id (>=0) or value <0 in case of error |
SDK_ERROR SDK_API SDK_InitMapDC | ( | SDK_INT4 | hdc, |
SDK_INT4 | paintLeft, | ||
SDK_INT4 | paintRight, | ||
SDK_INT4 | paintTop, | ||
SDK_INT4 | paintBottom, | ||
SDK_INT4 * | pHandle | ||
) |
Initializes a new MapDC.
Attention: This method works only under Windows (not UWP) with a given HDC!
An application can contain more than one MapDC. This allows to show multiple maps in one application. The MapDCs are independent from each other. This means they can show different sections of a map at the same time. MapDCs have to be released by calling SDK_ReleaseMapView()! Note that MapDCs are also memory consuming (a multiple of the amount required just for the internal bitmap representation). So watch the memory footprint and avoid creating too many unused MapDCs. Note also the map MapDCs should have a dimensions which are each multiple of 4.
[in] | hdc | Reference to Device context (dc) To offer all functionality the object must be capable of receiving and sending MouseEvents. |
[in] | paintLeft | Left coordinate of rect used for painting the map within the map DC |
[in] | paintRight | Right coordinate of rect used for painting the map within the map DC |
[in] | paintTop | Top coordinate of rect used for painting the map within the map DC |
[in] | paintBottom | Bottom coordinate of rect used for painting the map within the map DC |
[out] | pHandle | A mapdc id (>=0) or value < in case of error |
SDK_ERROR SDK_API SDK_SendMapViewEvent | ( | SDK_INT4 | MapView, |
const SDK_NavigationInformation * | pNavigationInformation, | ||
const SDK_MapViewEventData * | pMapViewEvent, | ||
void * | pixelData | ||
) |
Sends an event to a particular MapView.
Sends an event like a paint event or a mouse move event to the MapView. See GUI handling for a list of all possible events that can be sent.
This function has multiple purposes: First it will trigger a map update when the sent event is SDK_wmPAINT. Send this if you want to render the map. Second, it will resize the MapView if SDK_wmSize is sent (and the correspondent size is set in the SDK_MapViewEventData). Third, it is used to interact with the MapView standard interactors. The MapView has built in controls for zooming, panning and rotating to simplify interactions with the map. Some of these interactors are visible like the rotation control and some are not like the panning control. All these interactors can be enabled or disabled by calling \ref SDK_SetMapViewElements. The easiest way to use the interactors is to send all mouse events described in \ConstantsGUI to the MapView. Internally, the correct interactor will be chosen and the appropriate action will be performed.
Note that interacting with a MapView requires some care on the client side. Some basic UI handling is left up to the developer of the application to ensure all events are retrieved properly. E.g. mouse wheel events are sent to the window which has the focus. The Navigation SDK does not try to steal or set focus.
For convenience, messages which causes the MapView output to change (e.g. zooming by the mouse wheel) will implicitly call the map rendering function (as triggered by SDK_wmPAINT).
Attention: When rendering the map with SDK_wmPAINT, a route trace will only be rendered if pNavigationInformation is not NULL!
[in] | MapView | Handle to the MapView/MapDC. |
[in] | pNavigationInformation | Optional pointer to the NavigationInformation object. If non-NULL and the information belongs to a valid navigation situation the route is painted as a blue trace into the map. If null, a route trace will not be rendered, even if one is available! |
[in] | pMapViewEvent | Pointer to event structure. |
[in] | pixelData | Pixel buffer, only used when the mapview was initialized by SDK_InitMapViewFB and the event is SDK_wmSize |
SDK_ERROR SDK_API SDK_GetMapViewParameter | ( | SDK_INT4 | MapView, |
SDK_INT4 * | pCenterX, | ||
SDK_INT4 * | pCenterY, | ||
SDK_INT4 * | pScale, | ||
SDK_INT4 * | pOrientation, | ||
SDK_BOOL * | pMode3d, | ||
SDK_INT4 * | pPitch | ||
) |
Return a set of parameters of a certain map view.
Retrieve information about the scale, the center of the map and so on.
[in] | MapView | The internal number of the MapView/MapDC |
[out] | pCenterX | Pointer to variable where the actual x coordinate of the center is stored. |
[out] | pCenterY | Pointer to variable where the actual y coordinate of the center is stored. |
[out] | pScale | Pointer to variable where the scaling factor is stored. The scaling factor is a multiple of mercator units per pixel. |
[out] | pOrientation | Pointer to variable where the orientation is stored. |
[out] | pMode3d | Pointer to variable where the 3d flag is stored. |
[out] | pPitch | Pointer to variable where the pitch angle is stored. |
SDK_ERROR SDK_API SDK_SetMapViewParameter | ( | SDK_INT4 | MapView, |
SDK_INT4 | Mask, | ||
SDK_INT4 | CenterX, | ||
SDK_INT4 | CenterY, | ||
SDK_INT4 | Scale, | ||
SDK_INT4 | Orientation, | ||
SDK_BOOL | Mode3d, | ||
SDK_INT4 | Pitch | ||
) |
Set variables of a map view.
Set the parameters for a map view like the center of the map, the scale and so on. The bitmask defines which parameters to set.
[in] | MapView | Handle to the MapView/MapDC. |
[in] | Mask | Bitmask which defines the parameters. Bit 1 sets the center coordinates, bit 2 set the scale, bit 3 set the orientation bit 4 set 2d vs. 3d mode (e.g. a binary number 1101 means that center coordinates and orientation are set, scale is ignored, 2d/3d mode is set). See Map view parameters for a list of pre-defined constants. |
[in] | CenterX | The x coordinate of the center (Mercator) |
[in] | CenterY | The y coordinate of the center (Mercator) |
[in] | Scale | Defines the scaling. The scaling factor is a multiple of mercator units per pixel. |
[in] | Orientation | Defines the orientation. The value sets the rotation of the map (in degrees clockwise, 0 represents top). |
[in] | Mode3d | Toggles 3d mode (SDK_FALSE for 2d, SDK_TRUE for 3d) |
[in] | Pitch | The pitch angle for 3d mode in degrees between 0 and 90 |
SDK_ERROR SDK_API SDK_Zoom2Trace | ( | SDK_INT4 | MapView, |
SDK_INT4 | TraceId, | ||
SDK_INT4 | TranslateX, | ||
SDK_INT4 | TranslateY | ||
) |
Zooms to a custom trace. Use TraceId = 1 to zoom to current route trace.
[in] | MapView | id of the mapview |
[in] | TraceId | id of the trace |
[in] | TranslateX | translate by x pixels |
[in] | TranslateY | translate by y pixels |
SDK_ERROR SDK_API SDK_SetMapViewColorsFromFile | ( | SDK_INT4 | MapView, |
const SDK_WCHAR_T * | Filename, | ||
SDK_BOOL | IsDay | ||
) |
Set map view colors from file.
Set the colors for day/night from an external file given by filename (as an absolute path). The file is similar to the maprenderer.ini file, except that the color section is called [Colors] and that no other parameters than the colors will be read from the file.
[in] | MapView | Handle to the MapView/MapDC. |
[in] | Filename | Name of the file to load. |
[in] | IsDay | If true, the colors will be set as day colors, otherwise as night colors. |
SDK_ERROR SDK_API SDK_TranslateMapByPixelPos | ( | SDK_INT4 | MapView, |
SDK_INT4 | x1, | ||
SDK_INT4 | y1, | ||
SDK_INT4 | x2, | ||
SDK_INT4 | y2 | ||
) |
Translate the map by the given screen coordinates.
This function has to be used only when not using the standard map panning interactor (which is by default on). See SDK_SetMapViewElements for details on how to enable and disable map interactors. When the standard panning interactor is disabled, the panning must be done "manually" with this function. For moving the map, call this function with the last pixel position of the cursor in your view and the current position. The map will be moved by the difference of the two positions. Attention: to move correctly in the vertical screen direction, dependend on the vertical render direction set by SDK_InitMapViewFB, you may have to substract the current vertical position from the view height to move in the correct direction.
[in] | x1 | previous x-coordinate in screen pixels |
[in] | y1 | previous y-coordinate in screen pixels |
[in] | x2 | current x-coordinate in screen pixels |
[in] | y2 | current y-coordinate in screen pixels |
SDK_ERROR SDK_API SDK_SetMapViewStyles | ( | SDK_INT4 | MapView, |
SDK_BOOL | RenderHouseNr, | ||
SDK_BOOL | RenderStreetNames | ||
) |
Configure the rendering of house numbers and street names on the map.
This function will enable disable the rendering of streetnames and house numbers.
[in] | MapView | Handle to the MapView/MapDC |
[in] | RenderHouseNr | Dis/enable rendering of house numbers in 2d mode. In 3d they get never rendered. |
[in] | RenderStreetNames | Dis/enable rendering of street names in 2d mode. In 3d they get never rendered. |
SDK_ERROR SDK_API SDK_GetMapViewStyles | ( | SDK_INT4 | MapView, |
SDK_BOOL * | pRenderHouseNr, | ||
SDK_BOOL * | pRenderStreetNames | ||
) |
Retrieve information if rendering of house numbers and street names on the map is enabled or disabled.
[in] | MapView | Handle to the MapView/MapDC |
[out] | pRenderHouseNr | Dis/enable rendering of house numbers in 2d mode. In 3d they get never rendered. |
[out] | pRenderStreetNames | Dis/enable rendering of street names in 2d mode. In 3d they get never rendered. |
Retrieve the brightness of the MapView.
[in] | MapView | Handle to the MapView/MapDC |
[out] | pBrightness | Will be set to a Number between 0 (dark) and 100 (bright, day) |
Configure the brightness of the MapView. See SDK_SetMapViewDayNight() for an alternative.
[in] | MapView | Handle to the MapView/MapDC |
[in] | Brightness | Number between 0 (dark) and 100 (bright, day) |
Retrieve day and night mode setting.
[in] | MapView | Handle to the MapView/MapDC |
[out] | pFactor | Will be set to a number from day colour set (100) to night colour set (0) |
Switch between day and night mode.
[in] | MapView | Handle to the MapView/MapDC |
[in] | Factor | Gradually switch from day colour set (100) to night colour set (0) |
Retrieve the current background color of the mapview in the current design and mode.
[out] | bgColor | will be set to the current background color of the mapview |
Configure the graymode of the MapView.
[in] | MapView | Handle to the MapView/MapDC |
[in] | GrayMode | activate or deaactivete the gray mode of the MapView |
Retrieve gray mode setting.
[in] | MapView | Handle to the MapView/MapDC |
[out] | GrayMode | is graymode activate or deactivte |
SDK_ERROR SDK_API SDK_GetManeuverArrowVisibility | ( | SDK_INT4 | MapView, |
SDK_BOOL * | isVisible2d, | ||
SDK_BOOL * | isVisible3d | ||
) |
Retrieves the visibility of maneuver arrows - separately in 2d and 3d.
[in] | MapView | Handle to the MapView/MapDC |
[out] | isVisible2d | The visibility in 2d mode |
[out] | isVisible3d | The visibility in 3d mode |
SDK_ERROR SDK_API SDK_SetManeuverArrowVisibility | ( | SDK_INT4 | MapView, |
SDK_BOOL | isVisible2d, | ||
SDK_BOOL | isVisible3d | ||
) |
Enables or disables the visibility of the maneuver arrows - separately in 2d and 3d.
[in] | isVisible2d | Sets visibility in 2d mode |
[in] | isVisible3d | Sets visibility in 3d mode |
SDK_ERROR SDK_API SDK_GetManeuverArrow | ( | const SDK_ManeuverDescription * | maneuver, |
const SDK_CrossingView * | crossing, | ||
SDK_INT4 * | maneuverArrow | ||
) |
Retrieve a simplified arrow representation for the given maneuver situation.
[in] | maneuver | |
[in] | crossing | |
[out] | maneuverArrow | (Maneuver arrow types) |
SDK_ERROR SDK_API SDK_SetMapViewElements | ( | SDK_INT4 | MapView, |
SDK_UINT4 | AddElements, | ||
SDK_UINT4 | RemoveElements | ||
) |
Enables or disables the built in map interactors.
The interactors are defined in List of map elements. Interactors are some kind of controls to zoom, pan or rotate the map. Some of them are visible, like the rotation and the measure interactor, some are not (like the panning and the wheel zoom interactor). The controls are by default on, but every interactor can be removed from the map. The main purpose of these controls is to make the interaction with the map easier. The only thing the user has to do is to send the mouse events "SDK_wmLBUTTONUP", "SDK_wmLBUTTONDOWN", "SDK_wmMOUSEMOVE" and "SDK_wmWHEEL" along with the position and or the wheel delta with SDK_SendMapViewEvent to the MapView. The SDK will automatically select the correct interactor and trigger the action for it. As you can see in the List of map elements, there are also two interactors for 3D in the list. The switch between the 2D and 3D interactor will be done automatically by the SDK, depending on the viewing mode. Manually activating or deactivating them when switching from 2D to 3D and vice versa is not necessary.
[in] | MapView | Handle to the MapView/MapDC. |
[in] | AddElements | Bool sum of elements to be added, e.g. SDK_mapMEASURECTRL|SDK_mapROTATIONCTRL |
[in] | RemoveElements | Bool sum of elements to be removed, e.g. SDK_mapMEASURECTRL|SDK_mapROTATIONCTRL |
SDK_ERROR SDK_API SDK_SetMapMarker | ( | SDK_INT4 | MapView, |
SDK_INT4 | CenterX, | ||
SDK_INT4 | CenterY, | ||
SDK_INT4 | Orientation, | ||
SDK_BOOL | bNorthenAdjusted, | ||
SDK_INT4 | Style | ||
) |
Position a marker indicating the current position on the map.
[in] | MapView | Handle to the MapView/MapDC. |
[in] | CenterX | The x coordinate of the center (Mercator) |
[in] | CenterY | The y coordinate of the center (Mercator) |
[in] | Orientation | Defines the orientation of the marker (if suitable). The valus is given in degree clockwise, 0 represents top. |
[in] | bNorthenAdjusted | if set to true the orientation is ignored and the marker is always directed towards the top of the map |
[in] | Style | Defines which kind marker is being drawn, see Map marker parameters. Use SDK_mm_None to remove the marker |
SDK_ERROR SDK_API SDK_GetMapMarker | ( | SDK_INT4 | MapView, |
SDK_INT4 * | pCenterX, | ||
SDK_INT4 * | pCenterY, | ||
SDK_INT4 * | pOrientation, | ||
SDK_BOOL * | pUp, | ||
SDK_INT4 * | pStyle | ||
) |
Retrieve information about the position of the marker indicating the current position on the map.
[in] | MapView | Handle to the MapView/MapDC. |
[out] | pCenterX | The x coordinate of the center (Mercator) |
[out] | pCenterY | The y coordinate of the center (Mercator) |
[out] | pOrientation | Defines the orientation of the marker (if suitable). The valus is given in degree clockwise, 0 represents top. |
[out] | pUp | if set to true the orientation is ignored and the marker is always directed towards the top of the map |
[out] | pStyle | Defines which kind marker is being drawn, see Map marker parameters. Use SDK_mm_None to remove the marker |
SDK_ERROR SDK_API SDK_CreateBuddy | ( | const SDK_WCHAR_T * | pBitmapName, |
const SDK_WCHAR_T * | pBuddypName, | ||
SDK_INT4 * | pBuddyId | ||
) |
Create an item (buddy) that can be rendered on the map.
Buddies are elements on the map with a custom bitmap (only the "PNG" format is supported) and a name. They can be dynamically positioned on the map. Also, an alert can be added to a buddy to recognize the entering or leaving of a zone around the buddy. The buddy must be positoned by SDK_PositionBuddy to show it on the map. The buddy will be shown on all map views!
[in] | pBitmapName | Path to a bitmap (only "PNG images are supported). The path can be the full path to the bitmap or a relative path to the application directory set by SDK_Initialize. |
[in] | pBuddyName | Name of the buddy that will be displayed on the map. May be NULL. |
[out] | pBuddyId | Will be set to unique buddy, or -1 in case of error |
Position a buddy on the map so it gets rendered at the next map update.
[in] | BuddyId | Valid buddy id |
[in] | CenterX | The x coordinate of the center (Mercator) |
[in] | CenterY | The y coordinate of the center (Mercator) |
Delete buddy.
Delete a previously created buddy.
[in] | BuddyId | Valid buddy id |
Get the number of buddy items.
[in,out] | buddyCount | the number of buddy items. |
SDK_ERROR SDK_API SDK_AddBuddyAlert | ( | SDK_INT4 | BuddyId, |
SDK_INT4 * | pBuddyAlertId, | ||
SDK_INT4 | Distance, | ||
SDK_INT4 | AlertTyp | ||
) |
Add an alert to a buddy with the given ID.
Alerts are used to recognize if a circular area around a buddy is entered or leaved. Alert types are SDK_ALERT_IN for entering an area and SDK_ALERT_OUT for leaving an area. The status of the alert must be checked by SDK_CheckBuddyAlerts. A buddy can have multiple alerts like in-alerts at 200, 300 and 400m and out-alerts at 100 and 300m. Attention: An alert will rise only one time, when the position, given in SDK_CheckBuddyAlerts, switches between inside and outside for SDK_ALERT_OUT or vice versa for SDK_ALERT_IN. So, if you get a positive check from SDK_CheckBuddyAlerts for a particular event, this event will not show up anymore, even if the transition situation is the same. You can't use an alert for checking if someone is inside or outside the radius. You only can check, if someone transits the zone. Because the alert will only rise once, you have to create a new one for this buddy if you want to be informed multiple times.
BuddyID | the ID of the buddy to add the alert | |
[out] | pAlertID | the ID that is assigned to the buddy alert for its lifetime |
Distance | the radius of the transit zone around the buddy | |
AlertTyp | type of alert, either SDK_ALERT_IN or SDK_ALERT_OUT |
Delete an alert with the given BuddyId and AlertID.
Deletes the corresponding alert of the buddy.
[in] | BuddyID | the ID of the buddy to delete |
[in] | AlertID | the ID of the alert to delete |
SDK_ERROR SDK_API SDK_CheckBuddyAlerts | ( | SDK_INT4 | CenterX, |
SDK_INT4 | CenterY, | ||
SDK_BuddyAlertState ** | pAlertState | ||
) |
Check if alerts exists for the given position.
Check if alerts exists and fill pAlertState with the corresponding information. pAlertState allocates memory which needs to be freed with SDK_FreeBuddyAlertState.
[in] | position | current gps-position |
[out] | pAlertState | struct with the state of all buddy alerts needs to be freed with SDK_FreeBuddyAlertState |
SDK_ERROR SDK_API SDK_FreeBuddyAlertState | ( | SDK_BuddyAlertState * | pAlertState | ) |
Free the memory of pAlertState which was allocated with SDK_CheckBuddyAlerts.
[in] | pAlertState | pointer to the SDK_BuddyAlertState which needs to be freed |
SDK_ERROR SDK_API SDK_AddImage | ( | const SDK_WCHAR_T * | pBitmapName, |
const SDK_WCHAR_T * | pText, | ||
const SDK_Position * | Position, | ||
SDK_INT4 * | pImageId | ||
) |
Add a png image at the given position to the map.
The image will be shown on all map views!
[in] | pBitmapName | Path to a bitmap (only the "PNG" format is supported). The path can de the full path to the bitmap or a relative path to the application directory (which was set in SDK_Initialize). |
[in] | pText | text centered on image |
[in] | Position | The coordinate of the image to be shown (mercator) |
outn] | pImageId The id of the added image |
SDK_ERROR SDK_API SDK_PositionImage | ( | SDK_INT4 | ImageId, |
const SDK_Position * | Position | ||
) |
(Re)Positions the image with the given id
[in] | ImageId | The id of the image to position |
[in] | Position | The coordinate of the image to be shown (mercator) |
Hilights the image with the given id.
[in] | ImageId | The id of the image to hilight |
[in] | Duration | The duration in milliseconds the image should be hilighted. 0 for infinite time, negative for removing highlight. |
Deletes the image with the given id.
[in] | ImageId | The id of the image to position |
SDK_ERROR SDK_API SDK_DeleteImages | ( | ) |
Delete all images set by SDK_AddImage.
SDK_ERROR SDK_API SDK_GetMapViewFixPoint | ( | SDK_INT4 | MapView, |
SDK_INT4 * | pRelPosX, | ||
SDK_INT4 * | pRelPosY | ||
) |
Get the fix point of the Map view.
The fix point is the point where the map rotates around.
[in] | MapView | Handle to the Mapview |
[out] | pRelPosX | Pointer to retrieve Position in 100*% of the screen pixel width counting from the center (e.g. offset to left[right] is indicated by -1[1] to -99[99]) |
[out] | pRelPosY | Pointer to retrieve Position in 100*% of the screen pixel height couting from the center (e.g. offset to lower[higher] is indicated by -1[1] to -39[39]) |
Adjust the fix point of the Map view.
The fix point is the point where the map rotates around.
[in] | MapView | Handle to the Mapview |
[in] | RelPosX | Position in 100*% of the screen pixel width counting from the center (e.g. to move left[right], use -1[1] to -99[99]) |
[in] | RelPosY | Position in 100*% of the screen pixel height couting from the center (e.g. to move lower[higher], use -1[1] to -39[39]) |
Releases a MapView/MapDC.
Call this to delete a single MapView/MapDC. Other map views of the application remain usable. When the NavigationSDK object is released, all its map views are released.
[in] | MapView | Handle to the Mapview |
SDK_ERROR SDK_API SDK_SetStandardTraceParameters | ( | SDK_INT4 | MapView, |
SDK_UINT1 | LineWidth, | ||
SDK_COLOR | InnerColor, | ||
SDK_COLOR | OuterColor, | ||
SDK_INT4 | TraceID | ||
) |
Adjust the visual appearance of traces.
Adjust the visual appearance of some generic trace types, including route and TMC traces.
[in] | MapView | Handle to the MapView/MapDC. |
[in] | 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. |
[in] | InnerColor | Color for the inner of the trace |
[in] | OuterColor | Color for the outer of the trace |
[in] | TraceID | the value 1 specifies the route trace, greater IDs specify TMC and/or custom traces. Values lower than 1 are ignored |
SDK_ERROR SDK_API SDK_AddTrace | ( | SDK_INT4 | MapView, |
SDK_BOOL | BeforeRouteTrace, | ||
SDK_INT4 | PolyCount, | ||
const SDK_Position * | pPolyPoints, | ||
SDK_COLOR | InnerColor, | ||
SDK_COLOR | OuterColor, | ||
SDK_INT4 | LineStyle, | ||
SDK_INT4 | LineWidth, | ||
SDK_INT4 * | pTraceID | ||
) |
Add a polyline to the internal rendering data.
[in] | MapView | Handle to the MapView/MapDC. |
[in] | BeforeRouteTrace | if SDK_TRUE polyline will be drawn before route trace (if any), else afterwards (e.g. on top) |
[in] | PolyCount | Number of polygon points |
[in] | pPolyPoints | non-NULL pointer to route trace |
[in] | InnerColor | Color for the inner of the trace |
[in] | OuterColor | Color for the outer of the trace |
[in] | LineStyle | unsupported |
[in] | 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. |
[out] | pTraceID | will be set trace ID to be used for further requests to that object, e.g. calls to SDK_RemoveTrace() |
Remove a trace from the map.
Removes a trace/polyline which was formerly added by SDK_AddTrace.
[in] | MapView | Handle to the MapView/MapDC. |
[in] | TraceID | trace id as obtained by SDK_AddTrace() to be deleted. Use negative values to remove all traces added via AddTrace() to the given Mapview. |
SDK_ERROR SDK_API SDK_SetAutoZoomSpeedScales | ( | SDK_BOOL | TrackingMode, |
SDK_UINT4 * | MarginalSpeeds, | ||
SDK_UINT4 * | scaleFactor2d, | ||
SDK_UINT4 * | scaleFactor3d | ||
) |
Set the auto zoom scales for the given speeds for tracking and navigation mode. The auto zoom uses in non maneuver situations the current velocity and the velocity of the current road segment to determine the scale value. There are five speed values at which the scale changes. Each speed value has a correspondent scale value in 2d and 3d. This function sets the speeds and the correspondent scale values.
The values are internally set to suitable values. You only have to call this function if you are not satisfied with these values. The default values are:
MarginalSpeeds [km/h]: | 0 | 30 | 50 | 80 | 110 | scaleFactor2d (TrackingMode == SDK_TRUE): | 32 | 44 | 68 | 220 | 400 | scaleFactor3d (TrackingMode == SDK_TRUE): | 20 | 29 | 56 | 112 | 220 | scaleFactor2d (TrackingMode == SDK_FALSE): | 32 | 40 | 168 | 440 | 720 | scaleFactor3d (TrackingMode == SDK_FALSE): | 24 | 32 | 100 | 280 | 400 |
\param[in] TrackingMode If set to SDK_TRUE, set the tracking speeds and scales, else the navigation speeds and scales will be set
[in] | MarginalSpeeds | The speeds at which the scale should change |
[in] | scaleFactor2d | The scales for the MarginalSpeeds in 2d |
[in] | scaleFactor3d | The scales for the MarginalSpeeds in 3d |
SDK_ERROR SDK_API SDK_SetAutoZoomScaleMargins | ( | SDK_UINT4 | minZoomSlow2d, |
SDK_UINT4 | minZoomFast2d, | ||
SDK_UINT4 | maxZoom2d, | ||
SDK_UINT4 | minZoomSlow3d, | ||
SDK_UINT4 | minZoomFast3d, | ||
SDK_UINT4 | maxZoom3d | ||
) |
Set the auto zoom scale margins in 2d and 3d. This function sets the minimum and the maximum zoom level the auto zoom can get when zooming is caused by a maneuver. There are two minimum levels for 2d and two minimum levels for 3d. The minZoomSlow2d/minZoomSlow3d will be the lowest scale the auto zoom can reach in a maneuver zoom in 2d/3d if the velocity is lower than 72 km/h. If the velocity is equal or higher than 72 km/h, the values of minZoomFast2d/minZoomFast3d will be used as minimum. The maxZoom2d/maxZoom3d values are the upper limit of the auto zoom in maneuver mode.
The values are internally set to suitable values. You only have to call this function if you are not satisfied with these values. The default values are:
minZoomSlow2d (speed < 72 km/h): 20 minZoomFast2d (speed >= 72 km/h): 50 minZoomSlow3d (speed < 72 km/h): 16 minZoomFast3d (speed >= 72 km/h): 36
maxZoom2d: 30000 maxZoom3d: 2600
\param[in] minZoomSlow2d Minimum zoom level for velocities < 72 km/h in maneuver zoom (2d) \param[in] minZoomFast2d Minimum zoom level for velocities >= 72 km/h in maneuver zoom (2d) \param[in] maxZoom2d Maximum zoom level in maneuver zoom (2d) \param[in] minZoomSlow3d Minimum zoom level for velocities < 72 km/h in maneuver zoom (3d) \param[in] minZoomFast3d Minimum zoom level for velocities >= 72 km/h in maneuver zoom (3d) \param[in] maxZoom3d Maximum zoom level in maneuver zoom (3d)
Set the auto zoom linear approximation stepping values To avoid jumping in or out while zooming, the auto zoom will add or substract at each call to SDK_DoAutoZoom() a stepping value to the current scale until the calculated scale will be reached. The default steppings are 1 for stepping out and 30 for stepping in (for 4 times calling the function per second).
[in] | stepOut | Incremental scale value for stepping out, default is 1 |
[in] | stepIn | Incremental scale value for stepping in, default is 30 |
SDK_ERROR SDK_API SDK_DoAutoZoom | ( | SDK_INT4 | MapView, |
const SDK_NavigationInformation * | NavInfo, | ||
const SDK_GPSData * | GPSData, | ||
SDK_BOOL | DoSmoothZoom | ||
) |
Calculate a scale value that depends on the current velocity, current street type and maneuver situation.
The auto zoom will automatically scale the map by the above parameters. It has two modes:
The zooming scales in non maneuver mode can be set for five speeds with SDK_SetAutoZoomSpeedScales for 2d and 3d and for tracking and navigation mode separately. To avoid jumping in or out while zooming, the auto zoom will add or substract at each call to SDK_DoAutoZoom() a stepping value to the current scale until the calculated scale will be reached (if DoSmoothZoom is set to SDK_TRUE). This stepping value can be changed by calling SDK_SetAutoZoomSteppingValues. The default steppings are 1 for stepping out and 30 for stepping in (for 4 times calling the function per second). If DoSmoothZoom is set to SDK_FALSE, the calculated scale value for the zoom will be set immediately, which means that the zomm level will jump. This is useful if you changed the auto zoom from the manual to auto zoom. In all other cases, setting the value to SDK_TRUE is the best choice.
This function must be called repeatedly in every navigation loop iteration to function correctly.
[in] | MapView | The mapview for which the auto zoom should be calculated |
[in] | NavInfo | The current navigation information. If valid and a maneuver is in front, the auto zoom will zoom to the maneuver, if null or no maneuver is in front, the auto zoom will zoom to the appropriate value given by the speed/scale tables. |
[in] | GPSData | The current gps data |
[in] | DoSmoothZoom | If set to SDK_TRUE, the internally calculated scale will be approached by adding the stepping values to the current scale at each call of this function until the scale is reached. |
© PTV Group 2018 | Generated on Mon Dec 17 2018 21:00:22 for NavigationSDK by 1.8.8 |