Skip to main content

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 SinceMinimum Operating System
CoPilot 10.9.0Windows 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

ValueDescription
MSG_IDT_MAP_FEEDBACK_GETGet all cached map feedbacks from device

Return Values

ValueResult
0Indicates a general connection failure
Greater than 0Success and indicated the number of bytes sent successfully to CoPilot

Return Codes

ValueDescription
MSG_IDT_MAP_FEEDBACK_GET_SUCCESSSuccessfully get all cached map feedbacks
MSG_IDT_MAP_FEEDBACK_GET_JSON_PARSE_ERRORWhile retrieving cached map feedbacks, some json is invalid
MSG_IDT_MAP_FEEDBACK_GET_NO_FEEDBACK_CACHEDNo map feedbacks found on the device
MSG_IDT_MAP_FEEDBACK_GET_NO_GENERIC_ERRORAny 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 SinceMinimum Operating System
CoPilot 10.9.0Windows 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

ValueDescription
MSG_IDT_MAP_FEEDBACK_CLEARClear all cached map feedbacks from device

Return Values

ValueResult
0Indicates a general connection failure
Greater than 0Success and indicated the number of bytes sent successfully to CoPilot

Return Codes

ValueDescription
MSG_IDT_MAP_FEEDBACK_CLEAR_SUCCESSSuccessfully delete all cached map feedbacks
MSG_IDT_MAP_FEEDBACK_CLEAR_FAILFailed 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 VersionMinimum Version Supported
CoPilot v10.9.0Windows 10
Android 4.1

Syntax (Prototyped in alkmsg.h)

Parameters

ValueDescription
pJsonJson 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

ValueDescription
MSG_IDT_MAP_FEEDBACK_SEND_SUCCESSSuccessful in sending the request to CoPilot
MSG_IDT_MAP_FEEDBACK_SEND_JSON_PARSE_ERRORJSON parsing failed - ensure a valid json object is being passed
MSG_IDT_MAP_FEEDBACK_SEND_INVALID_POI_JSONJSON has missing/incomplete fields required for map feedback
MSG_IDT_MAP_FEEDBACK_SEND_STOPINFO_NOT_PROVIDEDStop Type required feedback location but missing in JSON

Information on further information can be found below.

StopType: Integer

ValueDescription
0Last Stop
1Current location
2 (default)Choose Stop
3Pick 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

ValueDescription
TrueWill display the map feedback UI flow in CoPilot
FalseSubmit 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

ValueDescription
TrueReturn the picked feedback location to the calling application and stay on the map location pickup view
FalseProceed 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:

ValueDescription
0Missing Address
1Address Location Error
2Height Restriction
3Weight Restriction
4Truck Restriction
5Hazmat Restriction
6Missing Street
7Exit Sign Post Correction
8One Way Street Error
9Speed Limit Error
10Road Closure
11Turn Restriction
12Road Name Error
13Other

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.

Last updated July 11, 2023.
Contents