ClassBreak constructor

ClassBreak(
  1. {String description = '',
  2. String label = '',
  3. double minValue = double.nan,
  4. double maxValue = double.nan,
  5. ArcGISSymbol? symbol,
  6. List<ArcGISSymbol> alternateSymbols = const []}
)

Creates a new class break object with alternate symbols.

A class break can have alternate symbols to the primary symbol. Alternate symbols allow you to tailor the visualization of class break at different scales by selecting different symbol for different scales. Alternate symbols are supported only when class break's primary symbol and other symbols in alternate symbol list are of type MultilayerSymbol and have SymbolReferenceProperties defining valid min max scales at which the symbol becomes visible. Renderer will pick only one symbol at a given map scale. If primary symbol's scale range falls within the map's scale, primary symbol is used. If not, then symbols in alternate symbols list are iterated through and first symbol matching the current map scale is picked for rendering. A symbol becomes visible if the map scale is less than or equal to symbol's minimum scale and greater than symbol's maximum scale. For more information about Scale-based symbol classes and alternate symbols, see Use scale-based symbol classes.

Parameters:

  • description — A description of the class break. "Cities with a population under 100,000", for example.
  • label — A label for the class break. "0 - 100000", for example.
  • minValue — The minimum value of the range that defines the break.
  • maxValue — The maximum value of the range that defines the break.
  • symbol — A symbol used to represent elements in the class break.
  • alternateSymbols — The alternate symbols for the class break. Only MultilayerSymbol are supported as alternates.

Implementation

factory ClassBreak(
    {String description = '',
    String label = '',
    double minValue = double.nan,
    double maxValue = double.nan,
    ArcGISSymbol? symbol,
    List<ArcGISSymbol> alternateSymbols = const []}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreDescription = _CString(description);
  final coreLabel = _CString(label);
  final coreAlternateSymbols =
      alternateSymbols.toArray(valueType: _ElementType.symbol);
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_ClassBreak_createWithAlternateSymbols(
        coreDescription.bytes,
        coreLabel.bytes,
        minValue,
        maxValue,
        symbol?._handle ?? ffi.nullptr,
        coreAlternateSymbols._handle,
        errorHandler);
  });
  final ClassBreak object = ClassBreak._instanceCache.instanceWith(handle);
  object._symbol.cache(symbol);
  object._alternateSymbols.value.setCache(alternateSymbols);
  return object;
}