Google Maps InfoWindow Not Displaying

Had a weird scenario where two mapping sites stopped working.  They use Google Maps API version 3.9 and are currently static (ie there were no current changes being made to the site).  One day, the InfoWindow used to display information about a google marker stopped displaying the info window.  No script errors, nothing had changed in code for 3 or 4 months, and had been working fine until then.

I finally tracked it down and changed the following line :-

goInfoWindow.content = tsLabel;

and instead wrote it as :-

goInfoWindow.setContent(tsLabel);

and the InfoWindow then works fine.

I was unable to find others experiencing this problem, and couldn't see any notes on Google's site.  I thought I would post this so that others might find it and benefit.  Why using the infoWindow.content property would stop working, I have no idea.  At least infoWindow.setContent works without too much extra effort.

Comments

Popular posts from this blog

Morrisons Three Fish Roast

Get Friends and Family to Record Onto Your Yoto

How to Stop the Annoying Nag Message in Outlook Asking to Take Outlook Anywhere