If your map has a layer with a large number of features, you can configure binning to aggregate features into summary polygons. A single polygon called a bin represents all features within its boundaries. Bins are of equal area and size, and a bin appears wherever at least one feature lies within it. This is different from clustering where single features are not included in a cluster if they fall outside of the cluster radius.
Caution:
Use discretion when binning line and polygon features, as the underlying data could be misrepresented by the binning process. For recommendations on applying binning to high-density datasets, see Best practices for visualizing high-density data.
When you enable binning, the bins default to Counts and Amounts (color) styling using an aggregate count of features within each bin. Binning obscures much of the map while clustering allows other features or the basemap to remain partially visible. Use binning to create summary statistics fields and use them to style the layer.
You can set a bin size that is appropriate for the extent at which the map will be viewed. You can also create and format summary statistic fields, customize the bin style using those fields, and configure labels and pop-ups for the bins.
Enable binning
To enable binning on a feature layer, do the following:
- Confirm that you are signed in and, if you want to save your changes, that you have privileges to create, update, and delete content.
Note:
You can explore maps, add and configure layers, and more without signing in. To save your work, sign in before creating a map. - In Map Viewer, open the map containing the layer or add the layer directly.
- On the Contents (dark) toolbar, click Layers .
- In the Layers pane, select the layer on which you want to enable binning.
- On the Settings (light) toolbar, click Aggregation .
- In the Aggregation pane, turn on the Enable aggregation toggle button.
- Click Binning.
- On the Binning style, click Options and do any of the following to configure the bins:
- Adjust the Bin size slider to make the bins larger or smaller. Set a size that makes sense for the scale at which the map is intended to be viewed.
- Adjust the Scale threshold slider or click the drop-down menu below the slider to choose a scale threshold level. When a scale threshold is set and you zoom in farther than the scale threshold, the map will draw individual features.
- Add and edit fields to use in labels, pop-ups, and styling for the bins.
- Customize the bin labels.
- Customize the bin pop-ups.
- Click Bin style to change the appearance of the bins. See Apply styles to learn more about styling options.
- Close the Aggregation pane when you're finished.
Configure bin fields
When you enable binning, the bins are styled using Counts and Amounts (color). The map style uses a default count field. You can edit the default field; add new summary statistic fields for use in styling, labels, and pop-ups; and change the formatting.
To configure bin fields, do the following:
- Follow the steps of the Enable binning section above.
- In the Binning pane, click Bin fields.
- Optionally, expand the default field and specify its properties:
- Type a field alias in the text box.
- Under Formatting, turn the Show thousands separator toggle button on or off.
- To add a new field, do the following:
- Click Add field.
The field configuration options appear.
- Choose a data field from the drop-down menu.
Tip:
You can use a custom attribute expression written in Arcade instead of an attribute field to determine how the data is binned. Click Add expression and use the editor window to create the expression.
You can also use existing expressions to build new expressions; however, some variables may not work in all profiles—for example, an expression created for pop-ups may not work for aggregation. To use an existing expression, select it from the Suggestions tab under Existing.
- If you used a custom attribute expression, under Field type, select the attribute field type.
- Choose a statistic type from the drop-down menu.
- Optionally, type a field alias in the text box.
- Under Formatting, choose the number of decimal places from the drop-down menu and turn the Show thousands separator toggle button on or off.
- Click Add field.
- To delete a field, click Options and choose Delete.
Note:
The default fields used to create the bin cannot be deleted.
The fields you configure are available for use in styling, labels, and pop-ups. Formatting changes are automatically applied to any fields that are currently in use for the bins.
Configure bin labels
Labeling bins is similar to labeling individual features in a layer. You control the label style—font, text size, placement, and so on. You can keep the labels simple by showing the number of features in each bin, or, if the layer is styled using an attribute, you can use this attribute for the bin label. For example, if the layer shows parcels by their value per square foot, you can configure the bin label to show the average value per square foot of all the features in each bin. Map Viewer also allows you to use a label filter to only display labels on bins that meet the filter criteria.
Configuring label classes allows you to further customize bin labels. For example, you can use label classes to label each bin based on two attributes, such as the average earthquake magnitude and the earthquake count, using a different label style for each attribute. Bin label classes are configured in the same way as label classes for features.
To configure bin labels, do the following:
- Follow the steps of the Enable binning section above.
- In the Binning pane, click Bin label.
- In the Label features pane, turn on the Enable labels toggle button.
- Click Add label class to configure label classes, and specify the options for each class:
Note:
See Configure labels for more information about label configuration.
- Click the Label field selector, select a different field for the label, and click Replace.
The default label field is the number of features in the bin. If the layer is styled using an attribute, you can use the attribute as a label. To use a different summary statistic as a label, add a bin field.
Tip:
You can use a custom attribute expression written in Arcade instead of an attribute field. Click Use expression and use the editor window to create the expression.
You can also use existing expressions to build new expressions; however, some variables may not work in all profiles—for example, an expression created for pop-ups may not work for styles. To use an existing expression, select it from the Suggestions tab under Existing.
- Click Edit label filter, click Add expression, and set up a filter fo display labels on a subset of bins. For more information, see Apply filters.
- Click Edit label style. In the Label style window, change the label style options, including the font, text size and color, placement, offsets, and halo effect.
- Adjust the Visible range slider to change the visible range for the bin labels.
- Click the Label field selector, select a different field for the label, and click Replace.
Configure bin pop-ups
If you configure pop-ups for a bin, the pop-up appears when you click a bin on the map. You can customize the bin pop-ups to provide specific information about the features inside the bin.
To configure bin pop-ups, do the following:
- Follow the steps of the Enable binning section above.
- In the Binning pane, click Bin pop-ups.
- In the Pop-ups pane, customize the bin pop-ups by doing any of the following:
Note:
See Configure pop-ups for more information about pop-up configuration.
- Optionally, click Attribute Expressions to create and modify Arcade expressions to use in the bin pop-up.
- Expand the Title section and type a title for the pop-up. Type static text and click Add field to select attribute fields from the data.
- Click the Fields list content block, type a title and description for the fields list, and select which fields to include in the list.
- Click Add content, click the content type, and add content and media to the bin pop-up, including images and attribute fields.
- Drag the content blocks to new positions in the pop-up to change the order.
- To remove content from the pop-up, click Options and choose Delete.
- Click the bins on the map to view the pop-ups.
Configure bin styling
Styling bins is similar to applying styles to a layer, and you can customize how bins are styled using smart mapping defaults.
To configure bin styling, do the following:
- Follow the steps of the Enable binning section above.
- In the Binning pane, click Bin style.
By default, the bins are styled using Counts and Amounts (color).
- Optionally, in the Bin styles pane, choose a different style based on what you want to show.
The style currently applied to the layer is selected in the Pick a style section. For help choosing a style, see the Styles quick reference table.
Note:
Only the options that apply to the data appear. Some styles also include a Theme option. Themes allow you to experiment with various views of your data. The availability of themes depends on the smart mapping style you choose.
- Optionally, click Style options on the style card to customize the look of the layer.
- In the Style options pane, click Done when you finish customizing your style, or click Cancel to return to the Bin styles pane without saving your choices.
- Close the Aggregation pane when you're finished.