Use URL parameters to modify embedded maps

Note:

This functionality is currently only supported in Map Viewer Classic. It will be available in a future release of Map Viewer.

Map Viewer Classic provides ready-to-use HTML code to embed a map in a website. You can choose options to include on the map, such as a home button, zoom control, and a legend, which are added to the code that you copy and paste into your website. Another way to add these options is to use URL parameters.

The URL for the embedded map always begins with the URL of your organization or the public site (https://www.arcgis.com) and /apps/Embed/index.html?webmap=<your web map ID>. The following is an example:

https://www.arcgis.com/apps/Embed/index.html?webmap=432a8d7ca22d4b5b859e0bdaa30ae118

The URL can also include one or more of the parameters listed below. Some URL parameters modify the behavior of the embedded map while others modify what functionality is available in the embedded map. To include more than one parameter, use an ampersand (&) to separate the parameters. The following is an example:

https://www.arcgis.com/apps/Embed/index.html?webmap=432a8d7ca22d4b5b859e0bdaa30ae118&legend=true&details=true

Note:

If any of the resources in the URL parameter are provided as HTTP, you must replace HTTP with HTTPS in the URL and make all resources accessible using HTTPS only.

Layout

The following parameters give you control of the look and feel of the map:

  • theme—Determines the color theme applied to the side panel and buttons. Valid options are light or dark.
  • legend—When set to true, a legend displays in the side panel showing the layers in the map.
  • details—When set to true, the map’s description text appears in the side panel.
  • active_panel—Sets which tab is active in the side panel when the map loads. Valid options are legend or details. The legend or details parameter must be set to true if used as the value for the active_panel parameter.
  • show_panel—When set to true, the side panel displays when the map loads. The default is false.
  • popup_sidepanel—When set to true, pop-up information is presented on the info tab of the side panel instead of in the map.
  • zoom_position—Determines the location of the zoom control buttons. Valid options are top-left (default), bottom-left, top-right, or bottom-right. If the home parameter is set to true, the home button also moves according to the value of the zoom_position parameter.
  • logoimage—URL to an image that is used as a clickable thumbnail in the map layout. Clicking the thumbnail redirects to the URL set with the logolink parameter.
  • logolink—URL to an external website or web resource. Clicking the thumbnail image set with the logoimage parameter redirects to the URL set in logolink.

Example of an embedded map with a dark theme, legend, show panel on load, zoom buttons on the upper right, and logo image that is linked to a web page.

https://www.arcgis.com/apps/Embed/index.html?webmap=432a8d7ca22d4b5b859e0bdaa30ae118
&theme=dark&legend=true&show_panel=true&zoom_position=top-right
&logoimage=https://cdn-png.si.com/sites/default/files/teams/basketball/cbk/logos/ind_200.png
&logolink= https://en.wikipedia.org/wiki/Indiana_University

Example of an embedded map with a legend, details, details as the active tab in the panel, and pop-ups displaying in the side panel on the info tab.

https://www.arcgis.com/apps/Embed/index.html?webmap=432a8d7ca22d4b5b859e0bdaa30ae118
&legend=true&details=true&active_panel=details&popup_sidepanel=true

Mapping

The following parameters control map navigation and visibility of mapping elements:

  • webmap—ID of the web map to display inside the embedded map viewer, for example, webmap=432a8d7ca22d4b5b859e0bdaa30ae118. The webmap parameter is mandatory.
  • extent—Specifies the extent to be used when the map loads. This overrides the map’s default extent. Only geographic coordinate system values are valid.
  • center—Centers the map using geographic coordinates (x,y).
  • level—The level ID of the cached scale as listed in the REST endpoint of the basemap. This determines the default zoom level when the map loads, for example, level=9.
  • zoom—When set to true, the zoom in and zoom out buttons are displayed. Their location in the map can be controlled by the zoom_position parameter.
  • home—When set to true, the home button is displayed. The home button is used to navigate back to the map’s default extent. If extent is set, the home button uses that extent instead of the map’s default extent. The home parameter is only valid if zoom is also set to true.
  • scale—When set to true, the scale bar is displayed. The scale bar appears in the lower-left corner of the map.
  • disable_scroll—When set to true, mouse scrolling for zoom is disabled. The default is true.
  • marker—Places a desired image as a marker symbol with a pop-up in the map at a chosen location. Syntax is marker=longitude;latitude;wkid;description;URL;title. Longitude and latitude are required; the other values are optional. The description and title values need to be encoded in the URL. Leave an optional value blank if you do not want to include it. The following is an example:
    marker=-86.52;39.18;;Assembly%20Hall;https://cdn-png.si.com/sites/default/files/teams/basketball/cbk/logos/ind_200.png
  • basemap_toggle—The basemap toggle button is displayed. This must be set to true in order to use alt_basemap.
  • alt_basemap—Controls which basemap is used as the alternate basemap in the basemap toggle. The basemap_toggle parameter must be set to true in order to use alt_basemap. If no alternative basemap is specified, the satellite basemap is used. Valid values are streets, satellite, hybrid, topo, gray, oceans, national-geographic, osm, terrain, and dark-gray.

Example of an embedded map with custom extent, zoom buttons disabled, scale bar present, mouse zoom scrolling enabled, and basemap gallery.

https://www.arcgis.com/apps/Embed/index.html?webmap=432a8d7ca22d4b5b859e0bdaa30ae118
&extent=-86.179,39.923,-85.932,40.075
&zoom=false&scale=true&disable_scroll=false&basemap_gallery=true

Example of an embedded map with center, zoom scale level, home button, and basemap toggle with an alternate basemap.

https://www.arcgis.com/apps/Embed/index.html?webmap=432a8d7ca22d4b5b859e0bdaa30ae118
&center=-86.39,39.84&level=16&home=true&basemap_toggle=true&alt_basemap=hybrid

Feature and location search (geosearch)

The following parameters search and find data in the map:

  • search—When set to true, the search widget is displayed. This widget supports searching through geocoding and searchable layers. The search parameter must be set as true in order to use find for searchable layers in the map.
  • searchextent—When set to true, a geosearch through the search widget returns results that are within the default extent of the map.
  • find—Opens the map at a specific location. The find parameter can be used for searching by addresses or places (geocoding) or for searching attribute field values from a searchable layer. This parameter returns results from all search resources to which the map has access. If your searchable layer values are similar to geocoding values, this could produce misleading results. For example, searching for five-digit FIPS codes from a searchable layer’s field could be confused with United States ZIP Codes and return multiple results that are not desired. Consider using feature for a feature search instead of find in scenarios such as this or when more fine-grained control over the results is needed.
  • feature—Allows searching for a specific feature in a searchable feature layer. Find Locations by Layer needs to be set up on the map for a searchable field. The syntax is feature=layerID;searchfield;searchvalue, for example, feature=CentralIndianaCities_634;PLACEFIPS;05860.

    The following URL references the central Indiana cities example above and can be used to discover the layer ID of the desired layer in your map. Notice id:CentralIndianaCities_634 under operationalLayers. Replace the webmap ID with the ID of your web map to find your layer ID.

    https://www.arcgis.com/sharing/rest/content/items/432a8d7ca22d4b5b859e0bdaa30ae118/data?f=json

Example of an embedded map that includes search, a search extent, and opens to a specific location.

https://www.arcgis.com/apps/Embed/index.html?webmap=432a8d7ca22d4b5b859e0bdaa30ae118
&search=true&searchextent=true
&find=500%20S%20Capitol%20Ave,%20Indianapolis,%20IN%2046225

Example of an embedded map that opens to a specific feature.

https://www.arcgis.com/apps/Embed/index.html?webmap=432a8d7ca22d4b5b859e0bdaa30ae118
&feature=CentralIndianaCities_634;PLACEFIPS;05860