Change ImageMapType options dynamically

439 views
Skip to first unread message

Pablo Gallardo

unread,
Aug 19, 2010, 9:38:28 AM8/19/10
to Google Maps JavaScript API v3
I am trying to change opacity of ImageMapType's tiles dynamically (in
the example I'm using a button, but the final idea is to add an slider
that controls opacity).

When pushing the button, opacity is set to 0, but only for the new
tiles. The old ones remains the same.

I have thought of hiding and showing the overlay, but I guess there
should be an smarter way... Is there a way to refresh ImageMapType's
options?

http://cort.as/08iO

This has been based on Davide Cremonesi's example:
http://neogismap.appspot.com/wms/index.html . Thanks in advance. ;)

Chad Killingsworth

unread,
Aug 23, 2010, 8:09:27 AM8/23/10
to Google Maps JavaScript API v3
Have you tried:

imgMapType.set('opacity', '0.1');

Chad Killingsworth

Pablo Gallardo

unread,
Aug 24, 2010, 12:05:26 PM8/24/10
to Google Maps JavaScript API v3
Thank for you the answer Chad. I have tried that line and I get the
Javascript error "Object doesn't support this property or method".

I had already observed this when inspecting code with FireBug: opacity
property didn't exist for imgMapType object, but it existed for
imgMapType.b .

On Aug 23, 2:09 pm, Chad Killingsworth

Pablo Gallardo

unread,
Sep 7, 2010, 5:10:13 PM9/7/10
to Google Maps JavaScript API v3
I guess that my problem has been answered in the following topic.
ImageMapType is designed for static images, so I should use a Custom
Map Type in order to achieve the functionaly I was looking for.

http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/f333ea8b2cbf53c9/56049b3edd2a60e6?lnk=gst&q=refresh+custom+map+type#56049b3edd2a60e6
Reply all
Reply to author
Forward
0 new messages