SDKs · Flutter
Step 5 — Taps & info windows
Respond to taps and anchor a widget above a marker.
UbHubMap(
options: options,
height: 480,
markers: markers,
onMarkerTap: (marker) => debugPrint('tapped ${marker.id}'),
onPolylineTap: (line) {},
onPolygonTap: (polygon) {},
onCircleTap: (circle) {},
onTap: (point) {}, // basemap tap only
onLongPress: (point) {}, // long press on the basemap
infoWindowBuilder: (context, marker) => Card(
child: Padding(padding: const EdgeInsets.all(8), child: Text(marker.label ?? '')),
),
);onMarkerTap/onPolylineTap/onPolygonTap/onCircleTapgive you the annotation and itsdata.onTapfires only for basemap taps;onLongPressis a long press on the basemap.infoWindowBuildershows your widget above the tapped marker and tracks the camera.