What's Changed
Note
This release has breaking changes.
We apologize for the quick change in 0.24.0: this version definitively stabilizes the signatures of feature interaction callbacks.
This release restores the feature id and makes the Annotation
parameter nullable for all feature interaction callbacks (tap
/ drag
/ hover
).
This unblocks interaction with style-layer features not managed by annotation managers (i.e. added via addLayer*
/ style APIs).
Warning
Breaking Changes
-
Tap:
OnFeatureInteractionCallback
→(Point<double> point, LatLng coordinates, String id, String layerId, Annotation? annotation)
. -
Drag:
OnFeatureDragCallback
→(Point<double> point, LatLng origin, LatLng current, LatLng delta, String id, Annotation? annotation, DragEventType eventType)
. -
Hover:
OnFeatureHoverCallback
→Point<double> point, LatLng coordinates, String id, Annotation? annotation, HoverEventType eventType)
. -
Update existing listeners: The short‑lived 0.23.0-only signatures (without
id
) are removed.- For unmanaged style layer features
annotation
isnull
(unmanaged
means sources/layers you add via style APIs likeaddGeoJsonSource
+addSymbolLayer
). - For managed annotations it is the
Annotation
object.
- For unmanaged style layer features
Reasoning
In 0.23.0 the move to annotation objects inadvertently dropped interaction for unmanaged style features. Reintroducing id
(and making annotation
nullable) normalizes all three interaction paths without creating phantom annotation wrappers.
Migration Example
Before (0.23.0):
controller.onFeatureTapped.add((p, latLng, annotation, layerId) {
print(annotation.id);
});
After (>=0.24.0):
controller.onFeatureTapped.add((p, latLng, id, layerId, annotation) {
print('feature id=$id managed=${annotation != null}');
});
Refactor / Quality
- (web) Refactored
onMapClick
(degenerate bbox + interactive layer filter) to surface features inserted via style APIs (unmanaged style-layer features) inonFeatureTapped
(previously skipped; returned now withid
,layerId
andannotation = null
) (#646). - (web) Ensure map container stretches vertically by adding
style.height = '100%'
to the registered div (prevents occasional zero-height layout issues in flexible parents) (#641)
Contributors: @andynewman10, @gabbopalma
Full Changelog: v0.23.0...v0.24.0