Map Layers widget

The Map Layers widget displays a list of map layers.

Examples

Use this widget to support app design requirements such as the following:

  • You want to list a map's layers and allow users to control their visibility.
  • You want to leave some layers off of your map's layer list.

Usage notes

This widget requires connection to a data source. You can connect to a data source directly or connect to a Map widget in your app. You can use the Map Layers widget on a page with or without a displayed map.

When you connect this widget to a Map widget, the Map Layers widget can provide users with the following interaction options for each listed layer. Each option must be turned on in the widget's settings:

  • Zoom to—Zoom the connected map to the extent of the layer.
  • Show labels or Hide labelsFor layers with labels, show or hide labels.
  • Increase transparency and Decrease transparency—Change the transparency of the layer in the connected map.
  • Details—Open the details page for the layer.
    Tip:

    If the layer is an ArcGIS Online item, clicking Details opens the layer's item page.

  • Enable pop-up or Disable pop-up—Turn pop-ups on or off. If you enable pop-ups, pop-ups appear when you select a feature from the layer.
  • Add to table—View the layer's attributes in a Table widget.
  • Export—Export all records from the corresponding layer to CSV, JSON, or GeoJSON formats.

Settings

The Map Layers widget includes the following settings:

  • Source—Connect the widget to a map in one of the following ways:
    • Show layers for map data only—Connect the Map Layers widget to a web map or web scene. The widget lists all the layers in the map or scene.
    • Interact with a Map widget—Connect the Map Layers widget to a Map widget.
      • If you connect a Map widget, any connected maps or scenes appear in a list in the widget settings. Click a map to open its configuration panel.
        • Customize layers—Customize which layers from the map appear in the Map Layers widget at run time. If you leave this setting turned off, all map layers appear in the widget.
  • Options—Select from a variety of options to appear in the widget for each listed layer.

    Most of the following options are only available when configuring this widget to work with a Map widget.

    • Zoom to—Include the Zoom to button for each layer.
    • Show or hide labelsFor layers with labels, allow users to show or hide labels.
    • Enable or disable pop-up—Allow users to turn pop-ups on and off for applicable layers in the connected map.
    • Transparency—Allow users to change the transparencies of layers in the connected map.
    • View layer details—Include the Details button. This is the only setting available under Options when you choose Show layers for map data only under Source.
    • Use tick boxes to control layer visibility—Include tick boxes that allow users to turn layer visibility on or off in the connected map.
    • Show legend—Display a legend for all visible layers.
      • Show legend for all visible layers by default—Expand the legend for all visible layers by default.
    • Reorder layers—Allow users to drag layers to reorder them at run time. This setting is applicable when there are at least two layers.
    • Search layers—Include a search box at the top of the widget panel that allows users to search for layers by name. This setting is applicable when there are at least two layers.

Interaction options

The Map Layers widget supports data actions, which you can enable on the Action tab of the widget's settings.

Data actions add buttons to the widget's user interface for performing data processing tasks. The Map Layers widget currently supports the following data actions at the data source level. When the target is a widget, the data action appears as an option in the Map Layers widget's settings when you add one of those widgets to the app.

TargetData action

Framework

Export

Set filter

Statistics

Near Me widget

Set location

Table widget

Add to table