Map reports

The SDK allows users to submit map events, such as road accidents, hazards, and other incidents, and notify developers about errors in the map, such as missing roads or incorrect information.

This is done through the MapReportsManager class, which has the following functionality:

  • Submitting various types of map reports using the submitReport method.

  • Adding, removing, and submitting map events, checking for pending events and their submission status.

  • Reporting and managing map errors, checking for pending errors and their submission status.

  • Tracking the submission status of events and errors.

The following types of reports are supported:

  • Accidents

  • Road closures

  • Hazards

  • Map errors

  • Police

  • Road works

  • Safety cameras

  • Traffic

  • Dangerous weather conditions

The following map errors can be reported:

  • Blocked streets

  • Incomplete addresses

  • Missing addresses

  • Missing barriers

  • Missing speed limits

  • Missing streets

  • Missing stations

  • Missing stops

  • One-way roads

  • Wrong turns

  • Incorrect roundabouts

To submit a new report, obtain an instance of the MapReportsManager using the Sdk.getMapReportsManager() method, then create a report and call the submitReport method:

MapReportsManager manager = sdk.getMapReportsManager(); MapCoordinates reportLocation = sdk.getPositionManager().getCurrentPosition().coordinates(); MapReport report = new MapReportMapError(reportLocation, MapErrorType.MISSING_ADDRESS); report.setComment("This building does not have an address"); manager.submitReport(report);

Each report needs to have a location, and it can also have the following information attached to it:

  • Address

  • Road side

  • Comment

Specific types of reports also have additional information. For example, for road accidents, it’s possible to specify whether it was a minor or a major accident.

To listen for report submission events, implement the MapReportsManager.Callback interface and add it to the manager using the addCallback method. The following notifications can be received:

  • A new report was added.

  • An existing report was updated.

  • An existing report was removed.

  • Report submission was started or finished.

It’s also possible to check if a particular event or error is being submitted at the moment using the isEventSubmissionInProgress and isErrorSubmissionInProgress methods.

To check for reports that haven’t been submitted yet, use the hasPendingMapEvents or hasPendingMapReports methods. If either of these methods returns true, the corresponding reports can be submitted using the submitPendingMapEvents and submitPendingMapReports methods.

Local copies of reports can be removed using the removeMapEvent and removeMapReport methods.

To get the number of existing reports, the getMapEventCount and getMapErrorCount methods can be used. An existing report can be retrieved by its index using the getMapEvent and getMapError methods.