Home > @magiclane/maps-sdk > SocialOverlay
SocialOverlay class
Static service for crowd-sourced social event reporting and interaction.
Provides a complete system for creating, managing, and interacting with user-generated reports about real-time road conditions and incidents.
Overlays
Signature:
export declare abstract class SocialOverlay Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
Provides access to social report category hierarchy and metadata. | ||
|
|
TransferStatistics |
Provides network traffic statistics for social reports operations. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
|
Adds a text comment to an existing social report. Submits user commentary on a social report, visible to all users viewing that report. Comments support community discussion and provide additional context. The comment appears in OverlayItem.previewData. Operation executes asynchronously with result delivered via onComplete callback. | |
|
|
Cancels an ongoing social overlay operation. Terminates an active asynchronous operation started by methods returning ProgressListener, such as report(), confirmReport(), denyReport(), deleteReport(), updateReport(), or addComment(). Cancellation prevents the onComplete callback from executing. | |
|
|
Provides positive feedback (upvote) for a report. Confirms that a reported event is accurate and still in effect, increasing the report's score value. Each user can confirm or deny a report only once. The operation executes asynchronously with result delivered via onComplete callback. | |
|
|
Permanently removes a user's own report. Deletes a social report created by the current user, removing it completely from the map for all users. Only the original report creator has authority to delete their reports. The operation executes asynchronously with result delivered via onComplete callback. | |
|
|
Provides negative feedback (downvote) for an inaccurate report. Denies that a reported event is accurate or still in effect, decreasing the report's score. Reports with many downvotes are automatically removed to maintain information quality. Each user can confirm or deny a report only once. The operation executes asynchronously with result delivered via onComplete callback. | |
|
|
Retrieves the image snapshot associated with a social report. Downloads the photo attached to a social report when submitted with image data. Only applicable to Social Reports Overlay items. Returns image via onComplete callback with Img result. Operation executes asynchronously with progress tracking. | |
|
|
Prepares a report using the device's current high-accuracy position. Validates position accuracy and rate limits, then generates a preparation ID for submitting a report via report(). Required for most report categories. The position must be classified as high-accuracy by the map-matching system to ensure report reliability. Operates in two modes based on categId: - **Preparing mode** (categId = 0): Returns a preparation ID for use with report. The ID expires after a short time (typically minutes). - **Dry run mode** (categId ≠ 0): Tests if reporting is possible for the category without actually preparing. Returns error code as integer. | |
|
|
Prepares a report for submission using explicit coordinates. Validates and prepares a report at the specified geographic location without requiring active position tracking. Works only for Weather Hazard and its subcategories. Other categories require prepareReporting with high-accuracy position data. Operates in two modes based on categId: - **Preparing mode** (categId = 0): Returns a preparation ID for use with report. The ID expires after a short time (typically minutes). - **Dry run mode** (categId ≠ 0): Tests if the category can be reported at these coordinates without actually preparing. Returns error code as integer. | |
|
|
Registers a listener to monitor changes to a specific social report. Subscribes listener to receive notifications when the specified social report is modified (e.g., updated parameters, new comments, score changes). Use with unregisterReportListener to stop monitoring. | |
|
report({ prepareId, categId, description, snapshot, format, params, onComplete, }, input) |
|
Submits a prepared social event report to the community. Uploads a previously prepared report (via prepareReporting or prepareReportingCoords) with the specified category, optional description, image snapshot, and custom parameters. The report becomes visible to all users with social overlay enabled and displays for a limited duration before automatic removal. |
|
|
Unregisters a listener from monitoring a specific social report. Removes listener subscription from the specified social report, stopping change notifications. Call when no longer interested in report updates to prevent memory leaks and unnecessary callbacks. | |
|
|
Modifies parameters of an existing owned report. Updates custom parameters for a report created by the current user, such as location address or other metadata. The params structure must follow the format from OverlayItem.previewDataParameterList. Only the original report creator has authority to update their reports. |