v2.6.0
Features ✨ and improvements 🏁
- Introduce the experimental Interactions API, a toolset that allows you to handle interactions on both layers and basemap features for styles. This API introduces a new concept called
Featureset, which allows Evolving Basemap styles, such as Standard, to export an abstract set of features, such as POI, buildings, and place labels, regardless of which layers they are rendered on. AnInteractioncan then be targeted to these features, modifying their state when interacted with. For example, you can add aTapInteractionto your map which targets thebuildingsFeatureset. When a user taps on a building, the building will be highlighted and its color will change to blue.
var tapInteraction = TapInteraction(StandardBuildings(),
(_, feature) {
mapboxMap.setFeatureStateForFeaturesetFeature(feature, StandardBuildingState(highlight: true));
log("Building group: ${feature.group}");
});
mapboxMap.addInteraction(tapInteraction);Specific changes:
- Introduce the experimental
MapboxMap.addInteractionsmethod, which allows you to add interactions to the map. - Introduce
TapInteractionandLongTapInteraction, which allow you to add tap and longTap interactions to the map. - Introduce
FeaturesetDescriptor-- and convenience descriptors forStandardBuildings,StandardPOIs, andStandardPlaceLabels-- which allow you to describe the featureset you wantInteractionsto target. - Introduce low-level methods for creating and manipulating interactive features:
queryRenderedFeatures,querySourceFeatures,setFeatureState,getFeatureState,removeFeatureState,resetFeatureState - For more guidance with using these new features see
interactive_features_example.dart. - Align tap propagation behavior on Android and iOS.
- Add support for Swift Package Manager.
Bug fixes 🐞
- [Android] Fix bug in .setStyleImportConfigProperties() where map values were not being set correctly.
- [Android] Fix throwing NPE when converting a map with null values to a Value.
- Align tap propagation behavior on Android and iOS.