symbolForFeature method

ArcGISSymbol? symbolForFeature({
  1. required Feature feature,
  2. bool applyAttributeOverrides = false,
})

Returns the symbol that is used to visualize the given feature with override attributes from the renderer.

If applyAttributeOverrides is set to true, this method will get the symbol from the renderer and override the symbol properties with the overrides available on the renderer. These include visual variable size, color, opacity and rotation. If the override expression or attributes contain any information not known to either the renderer or observation (such as "scale"), that override will not be applied. If the override attributes are applied successfully, a symbol with overridden properties will be returned otherwise the original symbol will be returned.

If the renderer is a DictionaryRenderer and its associated DictionarySymbolStyle references a style file hosted on ArcGIS Online or an ArcGIS Enterprise portal (also referred to as a web style), this method returns null. If the layer has rendered and the symbol is already drawn on the view, this method returns a valid MultilayerSymbol. If you want to get the symbol before the layer is rendered, use DictionarySymbolStyle.getSymbolAsync(Dictionary<String, Object>).

Parameters:

  • feature — The feature.
  • applyAttributeOverrides — boolean value if set to true applies the override attributes from renderer.

Return Value: An ArcGISSymbol.

Implementation

ArcGISSymbol? symbolForFeature({
  required Feature feature,
  bool applyAttributeOverrides = false,
}) {
  final objectHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_Renderer_getSymbolForFeatureWithAttributeOverrides(
      _handle,
      feature._handle,
      applyAttributeOverrides,
      errorHandler,
    );
  });
  return ArcGISSymbol._fromHandle(
    objectHandle,
  );
}