Add swipe widget to map tour template

611
2
02-04-2014 12:04 PM
EvanThoms
Occasional Contributor II
Could someone give me some pointers on how I might add a swipe widget to a map tour template? I am working with the unhosted template files on my own computer and I have fiddled with the swipe widget example in the sandbox enough so that I kind of understand it.

But the template is more complex, so as a newb I don't understand exactly where to put the chunks of widget code into my index.html.

thanks
0 Kudos
2 Replies
EvanThoms
Occasional Contributor II
So, I am getting somewhere. Taking the code from

https://developers.arcgis.com/javascript/jssamples/widget_swipe.html

and jamming it into the index.html that comes with Storytelling-MapTour-2.2.1 

https://github.com/Esri/map-tour-storytelling-template-js

I have successfully gotten my swipe widget and basemaps to appear....behind the thumbnails of my images down in the image carousel. What appears to be happening is that I am creating two map containers and one is getting placed incorrectly. I can sort of follow from the swipe example how the map is created to which the swipe widget is attached.

What I can't figure out from the tour map template is where the equivalent is being done, that is, where the map is being created and how to reference it again. The example uses 'arcgisUtils.createMap' which is nowhere in the template.

It looks like it might be happening through the loading of "storymaps/maptour/core/MainView". Where can I read more about that?

Any nudges are greatly appreciated,
0 Kudos
EvanThoms
Occasional Contributor II
I have dug through the code in the full developer's download and found the various modules loaded during creation of the tour map template, but I still cannot figure out how to pass a reference to the Map class to the sample code for the swipe widget. In the sample, the creation of the map is right up front in the html, but in the story map template, it's nested away in the dependencies. Can I even get to the map object from the Core or MainView variables inside the OnLoad function?
0 Kudos