Here is my test page:
It works fine. If you click any of the red markers on the map, you get a details "info window". The click event is coded like this:
infowindow.setContent('<p><b>Play It Again Sports - Wyomissing</b><br />1050 Berkshire Blvd, Wyomissing, PA 19610<br />United States<br />610.779.8360<br />Distance: 5 miles or 9 kilometers</p>');
However, I would like to also trigger these "info window" events from other elements. For example, I setup a test button on that same page (you will see it at the top-right of the screen):
<input id="mybutton" type="button" value="click here" />
I tried handling that button like this:
...but I just get an error "cannot find the variable 'infowindow'".
How can I make it so clicking that button displays one of the five info windows on that screen? I guess I am not sure how to reference the info window, outside of the code that Google Maps API has already provided.