Toggle layers on and off in ArcGIS story maps

18784
19
Jump to solution
01-23-2015 06:54 AM
ValenLau
New Contributor

I have been very impressed with the idea of using ArcGIS story maps to show content and having the ability to customize the story map to your liking.

I would like to know if it is possible to have the user turn off/on layers within the legend in the story map template? Are there any sample codes in which I can refer to?

I know I could use ArcGIS JavaScript API to accomplish this, but I would like to stick with ArcGIS story maps if possible.

Thank you.

1 Solution

Accepted Solutions
OwenGeo
Esri Notable Contributor

Hi Michael,

In that case you might want to look at the Web AppBuilder. It is available as a separate tab when you share your map as a web application and provides a wizard-driven app design experience.

Screen Shot 2015-02-20 at 8.08.13 AM.png

Each story map app is designed for a very specific, focused user experience whereas WAB lets you create more generic apps with the standard tools GIS users are familiar with. For example it has a layer list widget that supports the functionality I believe you are looking for (see screenshot below).

If you want to publish an app for a more professional audience that lets them explore your data, make their own decisions about which layers are visible, and perhaps support other typical GIS functions (like viewing the attribute table) WAB lets you do that without any coding. The WAB also creates web apps that provide a good user experience in a desktop/laptop browser as well as on tablets and phones.

Screen Shot 2015-02-20 at 8.06.43 AM.png

Owen Evans
Lead Product Engineer | StoryMaps

View solution in original post

19 Replies
RupertEssinger
Frequent Contributor

Which Story Map application are you interested in using? There are several to choose from:

Apps | Story Maps

and we'd need to know which one you want to use in order to answer.

For example if you are interested in the Story Map Journal app ( Story Map Journal | Story Maps  ) you can define clickable 'actions' in the text at the side of the map that turn specific layers on and off in the map: that might match what you want and it is built-in to the Map Journal so there's no coding to do. For example this map journal uses those actions so the end-user can see click to see different time periods: The Age of Megacities represented by different layers.

In general we have not provided that layer on/off capability in the legend controls in the Story Map application layouts by default because the story map layouts aim to have very minimal GIS-type user controls and present self-contained maps to the user.

Rupert

0 Kudos
RileyQuarles
New Contributor

... thanks, that is a helpful answer - i am glad you gave an example of how it would work, rather than just saying that you need more information - now i can experiment with clickable actions in the story map journal - i appreciate your assistance - thanks again

Sent from my iPad

0 Kudos
MichaelLohr
Occasional Contributor II

I had not seen the defined clickable actions before. That definitely allows some user control over layers. I will be trying out the Map Journal. are the clickable actions enabled in other app templates?

Thank you, Rupert.

0 Kudos
MichaelLohr
Occasional Contributor II

Valen, I have found that the lack of flexibility in layer on/off control for end users is somewhat typical for the ESRI template based apps. They add new ones all the time so maybe it has changed. I have been told by more than one ESRI staffer that I should always use apps instead of plain web maps for und user consumption. I think Rupert mentions that is the intent, to keep things simple. But, I have found that to be very limiting for the type of maps we produce for our clients and in-house staff. My paying clients would fire me if I gave them a map without individual layer control.

If you have an MXD file with 10 layers of different project data that is embedded in a plain, ArcGIS online web map, the end users can toggle each one on and off as needed, and not look at the clutter of the rest. But if you instead publish that to one of the standard ESRI app templates, you are limited to turning on/off all the layers in that MXD at once. Not very useful for us. Your alternate is to publish instead, an individual map service for each data layer. When you have a hundred or so maps, this is not practical either.

Maybe ESRI could have a few templates that did allow multiple layer control.

Thanks for posting the question. They don't know how we use stuff, if we don't tell them.

RupertEssinger
Frequent Contributor

Another solution I'd like to suggest: use the new Story Map Series app ( Story Map Series | Story Maps ) to create a series of maps each of which shows a specific set of layers that your audience will want to see. It's a really cool app because it offers three layouts (tabbed, bulleted and side accordion) and if you want you can populate the whole series using a single map (you as the author choose which layers are shown from that map in which tab, bullet or accordion section) - you don't have to create multiple maps but of course you can.

Check out this ace example by Kentucky Commonwealth to see what I mean: http://kygeonet.ky.gov/StoryMaps/KyRecreationalResources/

Instead of a single old school Table Of Contents checkable layer list, which aren't usually very easy for the general public to understand, the story map presents 4 maps, each of which has a particular set of layers turned on. So stuff is pre-authored for the end-user.

More sophisticated controls can be added on via JavaScript customization though. For example have a look at the Filters in this customized map tour: Marine Important Bird Areas of Alaska

MichaelLohr
Occasional Contributor II

Thanks Rupert. I hadn't seen the series app. It definitely gives more flexibility and handles some simple layer combinations. On the Kentucky series, for example, if you wanted to see what hiking locations were associated with what state parks or rec areas, you have to toggle between those maps instead of seeing those layers overlaid together. You can't predict what all layer combinations users of the maps will want/need. Like I said, the apps keep getting better and better. But, that limitation keeps me from using the apps in the majority of maps I do.

OwenGeo
Esri Notable Contributor

Michael,

There are two ArcGIS Online templates that enable the user to toggle layers - the Basic Viewer and Classic Viewer.

Templates.png

If you feel that a subset of your audience still needs that feature you can publish a map of all relevant layers in one of those templates in addition to a pre-authored experience using the story map templates in the ways Rupert described. The viewer app can satisfy the needs of the more advanced users who want to manipulate the map while the simpler, directed experience provided by the story map template can be enjoyed by the rest.

Owen

Owen Evans
Lead Product Engineer | StoryMaps
0 Kudos
MichaelLohr
Occasional Contributor II

Great info, Owen. I will revisit those apps, sounds like they may have gained functionality since I initially used them.

0 Kudos
MichaelLohr
Occasional Contributor II

Owen, I have relooked at the two Viewers you mention having the layer toggling, Classic and Basic and they are the same as I recalled from previous work. These do NOT have full layering functionality back through to the underlying MXD file. If your MXD file has multiple shapefiles depicting differing data layers, these two viewers both will aggregate all the data layers from the MXD file into a single layer in the web app. The app will let you toggle everything in the MXD based on the on/off state in the MXD. But you can't toggle individual layers from the MXD in the app, like you can in a plain Web Map. Below you can see the layer "Lee County Base Layers" shown in the Classic Viewer. That layer comes from an MXD file published as a map service and contains 10 or 12 shapefiles for various project related datasets. As you can see, there is only one checkbox to toggle that entire MXD either on or off. I did not explain my issue with the layering well enough before.AtkinsADA2.jpg

0 Kudos