setStyleSourceProperty method

Future<void> setStyleSourceProperty(
  1. String sourceId,
  2. String property,
  3. Object value
)

Sets a value to a style source property. Note: When setting the data property of a geojson source, this method never returns an error. In case of success, a map-loaded event will be propagated. In case of errors, a map-loading-error event will be propagated instead.

@param sourceId A style source identifier. @param property The style source property name. @param value The style source property value.

@return A string describing an error if the operation was not successful, empty otherwise.

Implementation

Future<void> setStyleSourceProperty(
    String sourceId, String property, Object value) async {
  final String __pigeon_channelName =
      'dev.flutter.pigeon.mapbox_maps_flutter.StyleManager.setStyleSourceProperty$__pigeon_messageChannelSuffix';
  final BasicMessageChannel<Object?> __pigeon_channel =
      BasicMessageChannel<Object?>(
    __pigeon_channelName,
    pigeonChannelCodec,
    binaryMessenger: __pigeon_binaryMessenger,
  );
  final List<Object?>? __pigeon_replyList = await __pigeon_channel
      .send(<Object?>[sourceId, property, value]) as List<Object?>?;
  if (__pigeon_replyList == null) {
    throw _createConnectionError(__pigeon_channelName);
  } else if (__pigeon_replyList.length > 1) {
    throw PlatformException(
      code: __pigeon_replyList[0]! as String,
      message: __pigeon_replyList[1] as String?,
      details: __pigeon_replyList[2],
    );
  } else {
    return;
  }
}