Automatic Wikipedia Links in ArcGIS Online Popups

When adding a link to a popup in a map, using attribute-based URL parameters is a powerful ability. Bern Szukalski explains how to do this in this blog post.

He shows how to take the numeric ID from the a clicked feature (property parcel, in this case) and create a link with the ID so when the user clicks it will open the web page for that specific property ID.

alt text

What if you don’t have IDs and a specific URL pattern, but instead want to pass the name of your feature to enable the user to find some more information about it? You can use the same technique, using websites (like Google or Wikipedia) that take string searches as input.

For example, you may have the names of US Forest Service Wilderness Areas as an attribute, and you want to have a link to each wilderness area’s Wikipedia Page. Follow the instructions in Bern’s blog post, and create a link tag (<a href="...) where the beginning of the URL is https://en.wikipedia.org/wiki/Special:Search/ then insert the dynamic value of the “name” attribute column of your features (for example, {my_name_field}). So it will look something like this:

Popup configuration panel in ArcGIS Online

This will create a clickable Wikipedia link in the popup that will open the proper page for each item.

Popup in map with Wikipedia link

See the result in the interactive map of the Wilderness Areas in Mark Twain National Forest.

Other Formats

You could do this with other URL formats too, like

  1. Google “Feeling Lucky” search (send the user to the first search result)
    • http://www.google.com/search?btnI&q={ATTRIBUTE_NAME}
  2. Flickr image search (show a list of related Flickr photos)
    • https://www.flickr.com/search/?text={ATTRIBUTE_NAME}
  3. YouTube (send the user to the first video)
    • https://www.google.com/search?btnI&q=site:youtube.com {ATTRIBUTE_NAME}
  4. C-SPAN Search (list of related C-SPAN articles and videos)
    • https://www.c-span.org/search/basic/?query={ATTRIBUTE_NAME}

With what other websites can you use this technique? Let me know and I’ll add them to the list!

Get an email summary of my blog posts (four per year):

Join email newsletter

... or follow the blog here:

See Also