createFromAttributes static method

Future<SnapRules> createFromAttributes({
  1. required UtilityNetwork utilityNetwork,
  2. required FeatureTable featureTable,
  3. required Map<CaseInsensitiveString, dynamic> attributes,
})

Analyzes an UtilityNetwork for the rules which allow or limit the snapping of a feature in the given featureTable with the given attributes, and returns a SnapRules which can be used to configure interactive snapping behavior in a GeometryEditor.

To configure rule-based snapping, use this method to create a SnapRules that you can then pass to SnapSettings.syncSourceSettingsUsingRules. This method is ideal for creating SnapRules where you have a set of attributes, for example, if you are creating a new feature from a FeatureTemplate or by using a FeatureForm. Connectivity rules involving the UtilityAssetType of the feature are described by those attributes are included in the resulting rules.

Ensure that the feature tables underlying the given UtilityNetwork are the same used by operational layers in the map, so that the SnapRules are based on the same underlying data sets.

If your map view displays a web map, or is set from a MobileMapPackage, the ArcGISMap.utilityNetworks collection may already contain the relevant utility network object to use. Alternatively you may get the utility network from the same Geodatabase that backs your operational layers, or call UtilityNetwork.new to create the network from a ServiceGeodatabase and associate it with your ArcGISMap using ArcGISMap.utilityNetworks.

Parameters:

  • utilityNetwork — The UtilityNetwork object to analyze for its connectivity rules relating to a feature of the asset type described by the given featureTable and attributes.
  • featureTable — The feature table that will contain the feature whose geometry will be edited in the GeometryEditor using the returned SnapRules. Must be part of the given utilityNetwork.
  • attributes — The attributes for the feature whose geometry will be edited in the GeometryEditor using the returned SnapRules.

Return Value: A SnapRules appropriate for interactively editing the geometry of a feature in the given featureTable with the given attributes.