Infowindow background color

11,740 views
Skip to first unread message

TTA

unread,
Jan 21, 2010, 6:26:28 AM1/21/10
to Google Maps JavaScript API v3
Hi All,

Is this possible to change background color of the info window? The
default info window background color is #FFFFFF (white). And there is
no method to change it. Please help.

-Thanks
TTA

Mike Williams

unread,
Jan 21, 2010, 7:00:43 AM1/21/10
to google-map...@googlegroups.com
Not really with GInfoWindow.

You could crawl through the DOM looking for references to
http://maps.gstatic.com/intl/en_ALL/mapfiles/iw3.png
and direct then to your own equivalent image, but opening the infowindow
is asynchronous, so the user will probably see an ugly flash of white
before the colour changes.

While crawling the DOM you'd need to look for <img src=""> and <div
style="background-image:..."> and calls to AlphaImageLoader if the
browser is MSIE.

Crawling the DOM is not futureproof. Google do change the image URL from
time to time. The image used to be iw.png, then iw2.png, and it used to
be in www.google.com/mapfiles/ and then in
www.google.com/intl/en_ALL/mapfiles/. Each of those changes would have
caused a simple search fro the image to fail.


Alternatively, you could use a third party window system like
ExtInfoWindows or EWindows.

--
Mike Williams

Esa

unread,
Jan 21, 2010, 7:25:12 AM1/21/10
to Google Maps JavaScript API v3

On Jan 21, 2:00 pm, Mike Williams <nos...@econym.demon.co.uk> wrote:

I agree but ExtInfoWindows and EWindows are v2 extensions.

There is a custom info window script for v3 by Pamela in the Demo
Gallery:
http://gmaps-samples-v3.googlecode.com/svn/trunk/infowindow_custom/infowindow-custom.html

Mike Williams

unread,
Jan 21, 2010, 8:20:31 AM1/21/10
to google-map...@googlegroups.com
Esa wrote

>I agree but ExtInfoWindows and EWindows are v2 extensions.

You're right. I'm not supposed to be in this group. I don't know how
that happened.

--
Mike Williams

Gary Little

unread,
Jan 21, 2010, 5:18:32 PM1/21/10
to Google Maps JavaScript API v3
You can easily change the background color if you use the new InfoBox
class (for V3) at google-maps-utility-library-v3

See http://code.google.com/p/google-maps-utility-library-v3/wiki/Libraries

See the reference here: http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html

Gary

TTA

unread,
Jan 22, 2010, 12:32:12 AM1/22/10
to Google Maps JavaScript API v3
Thank you Gary. Your information is very helpful.

-Thanks
TTA

Reply all
Reply to author
Forward
0 new messages