Home > @magiclane/maps-sdk > SocialOverlay > prepareReporting
SocialOverlay.prepareReporting() method
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.
Signature:
static prepareReporting(input?: {
dataSource?: any;
categId?: number;
}): number;Parameters
Parameter | Type | Description |
|---|---|---|
{ dataSource, categId, } | (not declared) | (Optional) |
input | { dataSource?: any; categId?: number; } | (Optional) |
input properties:
- Optional dataSource?: any
- Optional categId?: number
Returns:
number
**Dry run mode** (categId ≠ 0): - GemError.suspended.id: Report rate limit exceeded - GemError.invalidInput.id: categId is not a valid category ID - GemError.notFound.id: No valid high-accuracy position available - GemError.required.id: dataSource type is not live - GemError.notSupported.id: The category does not apply at the current position, e.g. an "opposite side" road category while on a one-way road with no opposite carriageway **Preparing mode** (categId = 0): - GemError.suspended.id: Report rate limit exceeded - GemError.notFound.id: No valid high-accuracy position available - Positive integer: Preparation ID for use with report (valid for short duration)