Map Switcher Widget for ArcGIS Experience Builder

398
1
11-13-2025 02:33 PM
Brian_McLeer
MVP Regular Contributor
2 1 398

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
1 Comment
ANRGIS
by
Frequent Contributor

Nice, 

This assumes that the map widget is widget_1. My applications map widget was coincidentally widget_6. I was able to modify my developer edition site to change the map widget to widget_1 so it would work with other Experience Builder enterprise edition sites. 

Pretty neat. 

Need to find a way to add some contextual text below the dropdown. I'll figure that out.
Thanks!

Contributors
About the Author
GIS Administrator/Developer at City of Grand Junction, CO.