hide/show layer when marker is selected

I'm creating a slide with markers, and I almost have it doing what I want, with the exception of the triggers.

I want to: Create a marker... on hover it just shows the title. I haven't added a description, so the callout never changes to show anything but just the title.  On click, it changes color and shows a layer. On click again, the color returns to normal, and the layer hides.

I got it all set up, but the hiding the layer doesn't work.  I created two triggers on the marker.  The first trigger shows the layer when the marker is clicked (with the condition that the marker is in the Normal state).  This works.  The second trigger hides the layer when the marker is clicked (with the condition that the marker is in the Selected state). This does not work.  The color of the marker (the state indicator) changes colors as I toggle it so I know the states are changing, but once the layer is shown, it never hides.

Thoughts?  Thanks!

14 Replies
Heather Beaudoin (Steckley)

Glad to know this is something I can fix, but I'm still a bit confused how to implement this.  In your story file, looks like you used 5 triggers to do what I was trying to do in 2 triggers.  I'm going to have about 10 markers on the slide.  Will I need a separate variable for each one to toggle markers 1-10 to show/hide layers 1-10?  Meaning 50 triggers (five for each of the 10)?

Honestly, I'm still confused about why putting the conditional on the states instead of the variables doesn't work.  I mean, if the marker is in Selected state, why can't "onClick" hide the layer?

Heather Beaudoin (Steckley)

Steve, your sample looks ok, but I can't get it to work when I add multiple markers.  The closest I've gotten is making you click twice on a marker to get it to work.  I basically want a group of markers to allow you to:

1. Hover over each marker to see the title of the callout.

2. When you click a marker, a layer is shown.

3. When you click the same marker, the layer is hidden.

4. If a layer is shown when you click a different marker, then it should just hide the first layer and show the next one for the new marker.

This seemed like it would be so easy when I started.  It's my first time looking at triggers, so I'm going by trial & error.  So far it's been lots of trials and lots of errors. 

Heather Beaudoin (Steckley)

I'm a bit closer... I mistakenly set the two triggers to Is Selected and Is Normal instead of Is Selected and Is Not Selected.  Works better now, but still not perfect.  I'm changing the color on the marker states between Normal (red) and Selected (green).  If 1 is Selected (green) and then you click 2, the color of 1 stays green even though the layer 1 goes away and layer 2 appears.  Is there a way to ensure only one marker is in Selected state at one time?


Thank you very much for your help.

Heather Beaudoin (Steckley)

WooHoo!  This worked! 

The only thing that it doesn't do is allow you to click the same marker to close the layer.  So, if marker 2 is selected and layer 2 is showing, you can't click marker 2 to hide layer 2.  However for my purposes, this will work just fine.

Steve, in your markerState.story, the first marker allows you to toggle it on/off.  However you can see what I'm getting when you try to toggle your 2nd and 3rd markers... the callouts don't close when you click them again.  I'm not sure why your first one works differently than the other two... all of mine won't toggle themselves.

Like I said that's not a deal-breaker for me, but I didn't know if you amazing gurus could solve that problem, too.

Thank you so much!