Home > @magiclane/maps-sdk > SocialOverlay > prepareReportingCoords

SocialOverlay.prepareReportingCoords() method

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.

Signature:

static prepareReportingCoords(coords: Coordinates, categId?: number): number;

Parameters

Parameter

Type

Description

coords

Coordinates

Geographic coordinates where the event is being reported. Must be valid latitude/longitude values.

categId

number

(Optional) Category ID for dry run validation, or 0 for actual preparation (default: 0). Use 0 when preparing for report submission.

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.accessDenied.id: Category doesn't allow coordinate-based reporting **Preparing mode** (categId = 0): - GemError.suspended.id: Report rate limit exceeded - Positive integer: Preparation ID for use with report (valid for short duration)