dynamicData property

Future<bool?> get dynamicData

Whether to optimize this source for frequent data updates, such as animated features.

Set this to true to change single features after you add the source, with MapboxMap.addGeoJSONSourceFeatures, MapboxMap.updateGeoJSONSourceFeatures or MapboxMap.removeGeoJSONSourceFeatures.

On web, set GeoJsonSource.dynamicData to true when you add the source, or this method throws a StateError. Android and iOS accept this method on every GeoJSON source. Android and iOS accept the three methods on every GeoJSON source and ignore this property.

The three methods find the feature to change by its id.

On web, GeoJSON feature ids must be a numeric string — GL JS's internal vector-tile pipeline only supports integer feature ids.

A dynamic source uses an index that is faster to update but slower to query, so set this only on sources that you change after you add them.

Default value: false.

Implementation

Future<bool?> get dynamicData async {
  final localStyle = style;
  if (localStyle == null) return null;
  final raw = (await localStyle.getStyleSourceProperty(id, "dynamic")).value;
  if (raw == null) return null;
  return raw as bool;
}