Position topic
The Position system delivers reliable device location and enhanced, map-matched positioning for navigation and location-aware features. Obtain raw and improved locations, stream position updates, and replay or simulate recorded traces. Use these building blocks to implement accurate location tracking, speed-aware UI, playback-driven simulations, and robust position-based event handling in production Flutter apps.
GemPosition: The primary representation of a raw location sample provided by the SDK. It models sensor- or provider-sourced coordinates and basic accuracy metrics for direct use in simple location displays, telemetry, or diagnostic workflows.GemPositionis suitable when you need the original, unmodified location reading from the device or external data sources.GemImprovedPosition: An enriched, map-matched position that extends raw samples with road-aware context such as posted speed limit, road modifiers, address information, and terrain data.GemImprovedPositionis the recommended class because it delivers stabilized coordinates and extra metadata.PositionService: The central service for accessing current position data and registering listeners for position updates. It provides access to the latest raw and improved positions, manages data source selection (live GPS, playback, or external sources), and returns listener handles for subscription management.GemPositionListener: The event listener abstraction that receives asynchronous position updates from the PositionService. It is used to subscribe to continuous raw or improved position streams and to implement custom handlers that react to location changes, quality variations, or map-matched events.
Precise and context-aware positioning is foundational for safe and useful map and navigation experiences. The suite of position classes converts noisy sensor data into actionable, map-matched insights, enabling accurate turn guidance, speed-limit awareness, and event triggers. Prefer using GemImprovedPosition as it provides stabilized coordinates and additional road context.
Learn more about positioning: https://developer.magiclane.com/docs/flutter/guides/category/positioning--sensors
Classes
- GemImprovedPosition Position
- Enhanced position data with map-matched information and road-specific details.
- GemPosition Position
- Represents raw GPS sensor data including geographical coordinates and movement information.
- GemPositionListener Position
- Position update callback interface for real-time location tracking.
- PositionService Position
- Provides access to device and custom position data and playback controls.