Cooper Thomas
Aug 31, 2018 · 1 min read

Hey David, thanks for sending the video. I ran it past one of our developers, and here’s what she had to say:

The tpl-ready fires in Map Series after the first section’s main stage loads. If that’s a map, the story-loaded-map event for it will have already fired by the time tpl-ready fires.
Two potential solutions:
1. Put the custom code outside the tpl-ready block
2. Keep the code inside tpl-ready, but first check to see if the map ID exists in app.maps before adding a listener for story-loaded-map. That would look something like this:

if (app.maps && app.maps[WEBMAP_ID] && app.maps[WEBMAP_ID].response && app.maps[WEBMAP_ID].response.map && app.maps[WEBMAP_ID].response.map.loaded) {
// custom code here
}

I hope this helps. Let me know if it works. If you have any questions, just holler, and I’ll do my best to answer—or at least point you toward someone who can!

    Cooper Thomas

    Written by

    Cartographer and Product Engineer @EsriStoryMaps.

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade