ArcGIS Online

Use attribute-based URL parameters in pop-up links

URL parameters are a handy way to pass information from one web page to another. For example, the ArcGIS Online map viewer takes the ID of the web map to open as a URL parameter, and ArcGIS Online web maps can make use of other URL parameters to define things such as the basemap, layers, and extent. When creating links, often URL parameters are used to identify and display specific content.

In this example we’ll take a look at how to construct a URL string to pass information from a pop-up to another website to display specific information using URL parameters from feature attributes. A custom pop-up display will be used to create the URL link to open the website using a unique attribute value when a feature is clicked.

 

The map

In this example we’re working with a parcel layer in a map. The pop-up for the parcel layer is shown below, note that the field APN contains the unique identifier for each parcel.

Parcel pop-up

 

The website

The county assessor’s website delivers detailed information for each parcel via the Property Information Management System (PIMS). The information can be retrieved by searching on the owner name, APN, or map book number. Below we’ve gotten the results for one of the parcels by entering the owner’s name.

Property information

Taking a closer look at the URL, we found that the unique identifier (the APN) for each parcel is included in the URL, appearing at the end after ?parcel=

URL parameter

 

The mission

Our mission is to display the parcel information from the PIMS website from a link in the layer pop-up, retrieving the specific information for the parcel that was clicked. Currently there is no direct link in our pop-up to access the Assessor’s PIMS website, but we do have the unique parcel identifier (in the APN field) for each parcel.

At the PIMS website we’ve learned that the URL takes the unique identifier (APN) as a parameter to retrieve information for any given parcel. Our challenge is to construct a link that passes the contents of the APN field as a URL parameter to the PIMS website, so we can open the parcel’s information from the feature pop-up.

 

The how

One way to accomplish our goal is to construct a custom link in the pop-up. Follow these steps (your steps may differ).

Step 1 – Click the layer options, then choose Configure Pop-up:

Configure pop-up

Step 2 – From the drop-down options under Pop-up Contents, choose A custom attribute display, then click Configure.

Configure

Step 3 – Configure the custom attribute display.

Using a custom attribute display you can use a combination of rich text, attributes, and links to create a custom information pop-up. For example, below we’ve combined a string with an attribute. Attributes appear as curly braces and can be selected from the attribute drop-down (the +). In the configured pop-up these will display the value from the feature attribute when the pop-up is opened.

Here’s the custom attribute display so far:

Custom attribute display

But we’re not yet finished. Our next task is to define a custom link that will add the APN to the URL to open the PIMS web page for each parcel clicked.

We added the string “View PIMS Info,” selected it, then clicked Create Link:

Custom attribute display

In Link Properties we copied and pasted the URL from the PIMS site, including ?parcel=, then added the field {APN} at the end. We noticed there were four extra trailing zeros that we also needed to include after the APN. Shown below is the end of the URL, with the field {APN} passed as a parameter plus the trailing zeros.

Link

Step 4 – Click Set to create the link, and save the pop-up.

 

The result

The pop-up now looks like this, with the View PIMS Info hyperlink.

Pop-up with link

When clicked, the hyperlink opens the PIMS page for the parcel. Mission accomplished!

Link from pop-up

 

More information

For more information see:

 

This post was originally published on October 4, 2012, and has been updated.

About the author

Tech evangelist and product strategist at Esri, focusing on ways to broaden access to geographic information and helping users succeed with the ArcGIS Platform. On a good day I'm making a map, on a great day I'm on one. Follow @bernszukalski or email bszukalski@esri.com

Connect:

Next Article

PerfTools (Build 122) for ArcGIS Pro 2.x is now available for download

Read this article