Map Switcher Widget for ArcGIS Experience Builder

89
0
yesterday
Brian_McLeer
Frequent Contributor
1 0 89

Overview

The Map Switcher widget provides a dropdown interface for navigating between different Experience Builder applications while preserving the current map extent and zoom level. The widget captures the URL hash fragment from the source application and appends it to the destination URL.

Note: An earlier version of this widget had hardcoded URLs in the code, which prevented it from being shared on the Esri Community. Experience Builder 1.19 introduced breaking changes that required the widget to be redeveloped. This version allows administrators to configure URLs through the widget settings panel, making it suitable for broader distribution.

Configuration Settings

The widget settings panel contains the sites configuration:

Sites Configuration:

  • Label: The display name that appears in the dropdown
  • URL: The full URL to the target Experience Builder application

Multiple sites can be added using the "Add Site" button. Sites can be removed using the "Remove" button for each entry. The widget does not require a map widget connection.

Widget Functionality

The widget displays a dropdown menu with the configured site options. The placeholder text reads "Select map to view".

Functionality:

When a user selects a destination from the dropdown:

  1. The widget captures the current URL hash fragment (everything after the # symbol)
  2. This hash contains map state parameters: center coordinates, zoom level, scale, rotation, and spatial reference
  3. The widget appends this hash to the selected destination URL
  4. The browser navigates to the new application

Features:

  • Works with any coordinate system (Web Mercator, State Plane, WGS84, etc.)
  • Preserves center point, zoom level, and rotation
  • URLs configured in settings panel
Contributors
About the Author
GIS Administrator/Developer at City of Grand Junction, CO.