ArcGIS Online

Use URL parameters in ArcGIS Instant Apps

ArcGIS Instant Apps feature a streamlined experience that lets you build apps quickly and easily using express or full setup modes. All Instant Apps templates can found on the searchable Instant Apps home page.

URL parameters can be used to pass along additional information or instructions to many ArcGIS Instant Apps. For example, you can zoom an app to a specific location, zoom in to a specific scale level, find a location, and more.

URL parameters follow a question mark (?) and are made of a key-value pair connected with an equal sign (=). For example, Map Viewer takes the ID of the web map to open as a URL parameter.

URL parameter syntax

Likewise, Instant Apps (like Media Map shown below) take the ID of the application to open as a URL parameter.

Instant App URL syntax

To include multiple parameters, separate them with ampersands (&).

Multiple URL parameters

 

URL encoding

URL encoding replaces characters with the percent sign (%) followed by their hex (hexadecimal) equivalent. In modern browsers, URL encoding is automatically added as needed when entering a URL in the browser address bar. When using embedded apps, encoding will be necessary.

For example, the following is an example using Basic Instant App that uses find to locate Redlands California. The space in the location is automatically replaced by %20 in the browser address bar:

https://www.arcgis.com/apps/instant/basic/index.html?appid=3ad44ff5f69047a29742cdd0c418a74a&find=redlands california

https://www.arcgis.com/apps/instant/basic/index.html?appid=3ad44ff5f69047a29742cdd0c418a74a&find=redlands%20california

The full URL encoding is as follows:

https%3A%2F%2Fwww.arcgis.com%2Fapps%2Finstant%2Fbasic%2Findex.html
%3Fappid%3D3ad44ff5f69047a29742cdd0c418a74a%26find%3Dredlands%20california

For more information, and to encode your strings, see URLEncoder.io

 

Examples

The following examples use Basic Instant App. Media Map supports the same parameters. Other apps will differ; experiment to see which parameters work in your chosen app.

Open the app as configured

The app is referenced by its ID, in this case 3ad44ff5f69047a29742cdd0c418a74a.

https://www.arcgis.com/apps/instant/basic/index.html?appid=3ad44ff5f69047a29742cdd0c418a74a

Specify a scale level

Scale is specified using &level=<LOD>.

https://www.arcgis.com/apps/instant/basic/index.html?appid=3ad44ff5f69047a29742cdd0c418a74a&level=10

Specify a location and scale level

The map is centered using &center=<x>,<y>.

https://www.arcgis.com/apps/instant/basic/index.html?appid=3ad44ff5f69047a29742cdd0c418a74a&center=-75.164422,39.954757&level=14

Specify an extent

&Extent uses two x,y coordinates to define the bounding box.

https://www.arcgis.com/apps/instant/basic/index.html?appid=3ad44ff5f69047a29742cdd0c418a74a&extent=-117.20,34.055,-117.19,34.06

Find a location of a feature to open the app

Use &find= followed by any search string.

https://www.arcgis.com/apps/instant/basic/index.html?appid=3ad44ff5f69047a29742cdd0c418a74a&find=Niagara Falls

Find an address to open the app

https://www.arcgis.com/apps/instant/basic/index.html?appid=3ad44ff5f69047a29742cdd0c418a74a&find=380 new york street, redlands, ca

Add a marker with a pop-up

&Marker uses the following properties. To skip a property use double semicolons (;;). The marker properties must be in this order:  &marker=<x>,<y>,<WKID>,<title>,<symbol URL>,<text>. Click the marker to view the pop-up.

https://www.arcgis.com/apps/instant/basic/index.html?appid=3ad44ff5f69047a29742cdd0c418a74a&marker=-118.292176;36.578494;;Mount Whitney;https://downloads.esri.com/agol/resources/symbols/misc/rm1.png;Mount Whitney is the highest mountain in the contiguous United States with an elevation of 14,505 feet (4,421 m).

Add a marker with pop-up and specify a zoom level

Add &level to the URL above. Click the marker to view the pop-up.

https://www.arcgis.com/apps/instant/basic/index.html?appid=3ad44ff5f69047a29742cdd0c418a74a&marker=-118.292176;36.578494;;Mount Whitney;https://downloads.esri.com/agol/resources/symbols/misc/rm1.png;Mount Whitney is the highest mountain in the contiguous United States with an elevation of 14,505 feet (4,421 m).&level=14

URL parameter marker

 

Custom URL parameters

In addition to the URL parameters described above, you can create your own custom URL parameter that zooms to a feature and displays the pop-up when the app opens. Custom URL parameters can be combined with other URL parameters, and are supported in Media Map, Sidebar, and Interactive Legend.

View the sample map and sign in to your account to follow along. The sample map contains a single parcel layer with a configured pop-up, which will be used to create the custom URL parameter.

Step 1 – Find the custom URL settings.

Custom URL parameters can be configured in full setup mode. To find the setting from express mode, click Search settings and enter “url.” Click URL parameter name to go to the setting.

Custom URL parameter

Step 2 – Configure the custom URL parameter.

2a – Enter the parameter name. In this case the parameter will be used to locate a specific parcel using its parcel identification number. The parameter name will be parcel.

2b – Select the layer to use in the parameter (Parcels is the only layer in the map).

2c – Select Field to display all fields in the layer.

Custom URL parameter

2d – From the fields drop-down, select Parcel Identification Number.

Custom URL parameter

The above settings support a new URL parameter (parcel) that takes the unique parcel identification number as the value. Examples of its use follow.

Find a parcel using the parcel identification number and view the pop-up:

https://www.arcgis.com/apps/instant/media/index.html?appid=468c6599832842bc8700f2afc529c88f&parcel=402306920

Find a parcel using the parcel identification number and view the pop-up, also adjust the zoom level:

https://www.arcgis.com/apps/instant/media/index.html?appid=468c6599832842bc8700f2afc529c88f&parcel=402306920&level=16

Locate parcel using custom URL parameter

 

More information

For more information, see:

This blog article was originally published on August 21, 2015, and has been updated.

 

About the authors

Corporate technology evangelist and advocate at Esri, focusing on ways to broaden access to geographic information and helping customers succeed with the ArcGIS system. On a good day I'm making a map, on a great day I'm on one. Email bszukalski@esri.com or connect on LinkedIn (https://www.linkedin.com/in/bernszukalski/).

Connect:

Product Engineer for ArcGIS Online and Configurable App Templates

Connect:

Next Article

Then & Now Swipe Map

Read this article