Map Feedback
Contents
Msg_IDT_MAPFEEDBACK_GET
This identifier will return map feedbacks stored on the device. It should be sent through Msg_SendGenericData and a return value will be returned through Msg_GenericTextDataGet.
The return codes are received by setting a callback with Msg.Msg_UpdateOptions(Msg.MSG_ID_GenericTextData, true, false, delOnGenericTextData, Msg.callingConvention.concention_stdcall);
and listening for MSG_IDT_MAP_FEEDBACK_GET and unwrapping the payload.
Supported Since | Minimum Operating System |
---|---|
CoPilot 10.9.0 | Windows 10, Android 4.1 |
Syntax (Prototyped in alkmsg.h)
public static native int Msg_SendGenericData(int lIdentifier, int lPayload, int lDestID, int lSrcID);
long Msg_SendGenericData(long lIdentifier, long lPayload, long lDestID = CONN_ID_NONE, long lSrcID = CONN_ID_NONE);
public static extern int Msg_SendGenericTextData(int lIdentifier, int lPayload, byte[] strPayload, int stringLen, int lRequestID, int lDestID, int lSrcID, bool bAck);
Parameters
Value | Description |
---|---|
MSG_IDT_MAP_FEEDBACK_GET | Get all cached map feedbacks from device |
Return Values
Value | Result |
---|---|
0 | Indicates a general connection failure |
Greater than 0 | Success and indicated the number of bytes sent successfully to CoPilot |
Return Codes
Value | Description |
---|---|
MSG_IDT_MAP_FEEDBACK_GET_SUCCESS | Successfully get all cached map feedbacks |
MSG_IDT_MAP_FEEDBACK_GET_JSON_PARSE_ERROR | While retrieving cached map feedbacks, some json is invalid |
MSG_IDT_MAP_FEEDBACK_GET_NO_FEEDBACK_CACHED | No map feedbacks found on the device |
MSG_IDT_MAP_FEEDBACK_GET_NO_GENERIC_ERROR | Any error other than above three |
Note: that even you receive MSG_IDT_MAP_FEEDBACK_GET_JSON_PARSE_ERROR, you may still get those feedbacks that are valid json. The returned json string will be delivered through Msg_GenericTextDataGet upon receiving the callback. See the sample code below to see how it works. The format of returned JSON string will be: {“mapfeedbacks”:[]} “mapfeedbacks” object contains an array of JSON map feedback requests you previously made
Sample Code
// Set up GenericTextData callback
Msg.delCallback delOnGenericTextData;
delOnGenericTextData = new Msg.delCallback(OnGenericTextData);
Msg.Msg_UpdateOptions(Msg.MSG_ID_GenericTextData, true, false, delOnGenericTextData, Msg.callingConvention.convention_stdcall);
// Send a request of getting map feedbacks
Msg.Msg_SendGenericData(Msg.MSG_IDT_MAP_FEEDBACK_GET, -1, -1, -1);
// Process the callback
void OnGenericTextData(uint pData, uint bytes)
{
int identifier;
int payload;
int iRequestID;
int iStrLen;
string genText = Msg.Msg_GenericTextDataGet(pData, bytes, out identifier, out payload, out iRequestID, out iStrLen);
switch (identifier)
{
case Msg.MSG_IDT_MAP_FEEDBACK_GET:
{
if (payload == Msg.MSG_IDT_MAP_FEEDBACK_GET_SUCCESS || payload == Msg.MSG_IDT_MAP_FEEDBACK_GET_JSON_PARSE_ERRO)
{
// genText is your returned map feedbacks
DoSomething()
}
}
break;
default:
break;
};
}
Msg_IDT_MAP_FEEDBACK_CLEAR
This API is used to delete map feedback stored on a device.
The return codes are received by setting a callback with Msg.Msg_UpdateOptions(Msg.MSG_ID_GenericTextData, true, false, delOnGenericTextData, Msg.callingConvention.concention_stdcall);
and listening for MSG_IDT_MAP_FEEDBACK_GET and unwrapping the payload.
Supported Since | Minimum Operating System |
---|---|
CoPilot 10.9.0 | Windows 10, Android 4.1 |
Syntax (Prototyped in alkmsg.h)
public static native int Msg_SendGenericData(int lIdentifier, int lPayload, int lDestID, int lSrcID);
long Msg_SendGenericData(long lIdentifier, long lPayload, long lDestID = CONN_ID_NONE, long lSrcID = CONN_ID_NONE);
alkmsg.cs
public static extern int Msg_SendGenericData(int lIdentifier, int lPayload, int lDestID, int lSrcID);
Parameters
Value | Description |
---|---|
MSG_IDT_MAP_FEEDBACK_CLEAR | Clear all cached map feedbacks from device |
Return Values
Value | Result |
---|---|
0 | Indicates a general connection failure |
Greater than 0 | Success and indicated the number of bytes sent successfully to CoPilot |
Return Codes
Value | Description |
---|---|
MSG_IDT_MAP_FEEDBACK_CLEAR_SUCCESS | Successfully delete all cached map feedbacks |
MSG_IDT_MAP_FEEDBACK_CLEAR_FAIL | Failed to delete cached map feedbacks |
Sample Code
Msg.Msg_SendGenericData(Msg.MSG_IDT_MAP_FEEDBACK_CLEAR, -1, -1, -1);
Msg_SendMapFeedbackJSON
This API is used to send map feedback to the MapSure service in JSON format.
Supported in following CoPilot Version | Minimum Version Supported |
---|---|
CoPilot v10.9.0 | Windows 10 |
Android 4.1 |
Syntax (Prototyped in alkmsg.h)
Parameters
Value | Description |
---|---|
pJson | Json format which will allow users to send map feedback to MapSure |
Example JSON
{
"coPilotVersion": "10.6.0.5",
"dataVersion": "GRD_ALK.NA-base-4.2017.02.13.11.1.3",
"description": "",
"heading": 0,
"speed": 0,
"timeStamp": 1504724835,
"issueType": 1,
"feedbackLocation": {
"Address": {
"StreetAddress": "124 North Nassau Street (NJ-27)",
"City": "Princeton",
"State": "NJ",
"Zip": "08542",
"County": "Mercer",
"Country": ""
},
"Coords": {
"Lat": "40.350010",
"Lon": "-74.658530"
}
},
"customFields": {
"StopType": 1,
"showUI": true,
"ReturnMapPickUp": true
}
}
Notes
Return Value
Value | Description |
---|---|
MSG_IDT_MAP_FEEDBACK_SEND_SUCCESS | Successful in sending the request to CoPilot |
MSG_IDT_MAP_FEEDBACK_SEND_JSON_PARSE_ERROR | JSON parsing failed - ensure a valid json object is being passed |
MSG_IDT_MAP_FEEDBACK_SEND_INVALID_POI_JSON | JSON has missing/incomplete fields required for map feedback |
MSG_IDT_MAP_FEEDBACK_SEND_STOPINFO_NOT_PROVIDED | Stop Type required feedback location but missing in JSON |
Information on further information can be found below.
StopType: Integer
Value | Description |
---|---|
0 | Last Stop |
1 | Current location |
2 (default) | Choose Stop |
3 | Pick point on the map |
For value 2, you have to provide a feedback stop, otherwise FAILURE_STOPINFO_NOT_PROVIDED error will be provided.
showUI: boolean
Value | Description |
---|---|
True | Will display the map feedback UI flow in CoPilot |
False | Submit the map feedback json without UI flow |
If timeStamp is included and the report is submitted through the UI flow, the timeStamp will be overwritten when submitted through the UI. The timeStamp will not be overwritten if showUI is set to false.
If showUI is set to be true, issueType is provided and so is a description, we will ignore these two fields as the issue type has been selected and/or description in the map feedback CoPilot UI flow.
If your StopType is PICK_ON_MAP but you set showUI to be false, you will end up getting FAILURE_INVALID_POI_JSON. So be careful about the combination of those options.
ReturnMapPickUp: boolean
Value | Description |
---|---|
True | Return the picked feedback location to the calling application and stay on the map location pickup view |
False | Proceed CoPilot feedback UI flow after picking up the location |
The picked location will be returned from the callback through the generic data identifier MSG_ID_Feedback_Location. This callback is under MapDataListener.
issueType:
Value | Description |
---|---|
0 | Missing Address |
1 | Address Location Error |
2 | Height Restriction |
3 | Weight Restriction |
4 | Truck Restriction |
5 | Hazmat Restriction |
6 | Missing Street |
7 | Exit Sign Post Correction |
8 | One Way Street Error |
9 | Speed Limit Error |
10 | Road Closure |
11 | Turn Restriction |
12 | Road Name Error |
13 | Other |
The API will either send the feedback to the ALK MapSure web service or cache it in local device. The decision is made by the following config:
[Mapsure]
"SendMapFeedbackOTA"=1
Setting the config to true (=1) will result in the API will sending the feedback to web service and not caching it on device. MapDataMgr.getMapFeedback() API should be used when set to =0 to send the information back to ALK. This can be used at certain times when you want to send the information to CoPilot.