Select to view content in your preferred language

Add widget to a Story Map template

7718
7
03-26-2014 10:30 AM
EvanThoms
Occasional Contributor II
Has anyone successfully added an extra javascript widget, from the samples for example, to a story map? Like the swipe tool or a basemap gallery?

In all of the samples at which I have looked, a 'map' variable is passed to the widget and I can usually see where in the code the map is created, through a createMap function, for instance. But I cannot figure out where the equivalent is happening in a story map template. There is no reference to 'createMap', no 'map' variable. I presume the creation is tucked away somewhere in the minimized js files. So, can I get a reference to it from my index.html?

If you have done this, please let me know!
0 Kudos
7 Replies
MarkCooney
Occasional Contributor III
Hi Evan,

If you are interested in modifying the source code, non-minified versions can be found in the developer's download links in the individual GitHub repos:

https://github.com/esri?query=storytelling

Mark
0 Kudos
EvanThoms
Occasional Contributor II
Thanks Mark,
If it comes to that, that's good to know. I just don't know if I need to do that or if I can put a few lines into my html and make it work. I will poke around in those un-minified versions, but if someone has a workflow they could share, I would be grateful.
0 Kudos
GregoryL_Azou
Regular Contributor II
Using the source code is the best way to go.
Alternatively you may be able to achieve what you want by adding your code to the deployment version through index.html.
See for example Map Tour developer guide. The application fire events that you can catch in index.html to add new features.

For most of storymaps template, you can access the map using 'app.map'.
0 Kudos
EvanThoms
Occasional Contributor II
Thanks Gregory,
that helps a bit. It looks like app.map is available as a hook. At least, when I type in 'app' on the console pane while debugging chrome, I get 'map' as an auto-fill choice.

Darn, I am close, my basemap gallery button is there and it opens when I click it, but no map icons are displayed
0 Kudos
ELIZABETHF_T_
New Contributor III

Hi Evan Thoms,

Were you successful adding the Basemap widget?, I'm trying the same thing, and I haven't been successful. 

0 Kudos
AndrewMartinez4
New Contributor III

I am also trying to add a query widget to my story map. Have you had any luck?

0 Kudos
YangLiu2
New Contributor II

I am trying to add a query widget in to the Basic-Viewer template. Does anyone have idea?

0 Kudos