DataInspectorControl

class DataInspectorControl(mapController: MapController)

A data control that queries map layers at a target coordinate and presents a callout.

DataInspectorControl owns a CalloutView anchored to a point within a host view. It executes asynchronous feature queries, coalesces/throttles updates for animated timelines, and formats results using layer-specific or default Presentations.

Usage

  1. Enable the control from com.xweather.mapsgl.map.MapController.addDataInspectorControl.

  2. Call show with a screen point and WGS‑84 coordinate to display and populate the callout (or rely on map tap, which forwards to the same pipeline).

  3. Call update as the underlying data animates or changes to refresh values.

  4. Call hide to remove the callout and disable inspector mode (on becomes false).

Off-screen anchor behavior

When the user pans or zooms, the controller reprojects the picked coordinate into mapView pixel space and repositions the callout via move. If that pixel lies outside the map view bounds (fully off-screen), behavior is controlled by cancelCalloutWhenOffScreen (default true):

  • true: The callout is dismissed (in-flight query cancelled, anchor cleared, UI deactivated). on remains true if it was already enabled so map taps can open a new inspection.

  • false: Legacy behavior: the bubble is only hidden with View.INVISIBLE while the inspector stays logically active so timeline-driven updates can continue in the background.

Constructors

Link copied to clipboard
constructor(mapController: MapController)

Properties

Link copied to clipboard

Whether the callout should be fully dismissed when its anchor pixel moves completely outside the mapView rectangle during camera moves (move / CalloutView.moveView).

Link copied to clipboard

Functions

Link copied to clipboard

Keeps the callout above legend/timeline siblings on the activity root.

Link copied to clipboard
fun hide()

Hides the callout, cancels any in-flight inspector query, and disables inspector mode.

Link copied to clipboard
fun move(point: ScreenCoordinate)

Repositions the callout for a new anchor in MapView pixel space (same space mapView width/height).

Link copied to clipboard

Removes any custom presentation associated with a layer identifier.

Link copied to clipboard
fun setPresentation(layerId: String, presentation: Presentation)

Registers a presentation for a layer identifier.

Link copied to clipboard
fun show(point: ScreenCoordinate, coordinate: Point)

Shows (or updates) the callout at a screen point for a geographic coordinate. executes an async query to populate its contents.

Link copied to clipboard
fun update()

Refreshes callout contents for the current targetCoordinate.