Changing opacity of shapes overlay

1,436 views
Skip to first unread message

rinogo

unread,
May 9, 2011, 1:59:31 PM5/9/11
to Google Maps JavaScript API v3
Hello, everyone!

I've been trying to figure out how to change the opacity of the shapes
overlay (e.g. circles, squares, polygons, and polylines that can be
drawn on a map). I've had no success thus far. Can someone with more
experience shed some light on how this might be accomplished?

Thanks so much! :)
-Rich

Radina

unread,
May 9, 2011, 3:28:13 PM5/9/11
to Google Maps JavaScript API v3
Related API Reference::

http://code.google.com/apis/maps/documentation/javascript/reference.html#Circle

Working example:

testCircle = new google.maps.Circle({
center: cTest,
map: myMap,
radius: rad, //km
fillColor: "#3333FF",
fillOpacity: 0.3,
strokeColor: "#3333FF",
strokeOpacity: 0.5
});

rinogo

unread,
May 9, 2011, 8:33:02 PM5/9/11
to Google Maps JavaScript API v3
Hi Radina (and everyone else),

Thanks so much for your answer. I probably should have clarified that
for what I'm attempting to do, I cannot use the opacity of specific
shapes. My shapes have to all have an opacity of 1.0, and I need to
reduce the opacity of the entire shapes overlay at once.

"Why?," you may ask? I've explained my approach here:
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/56c6d963d8187fc4

Any thoughts?
-Rich

On May 9, 1:28 pm, Radina <radi...@gmail.com> wrote:
> Related API Reference::
>
> http://code.google.com/apis/maps/documentation/javascript/reference.h...

Radina

unread,
May 11, 2011, 1:36:45 PM5/11/11
to Google Maps JavaScript API v3
Hi Rich:

Can you send us a link (see Posting Guidelines)?

Here are few tips:

- Declare global variable to hold current opacity
- Add listener that will listen for events which trigger opacity
change.

Thanks, Radina

On May 9, 5:33 pm, rinogo <ricosu...@gmail.com> wrote:
> Hi Radina (and everyone else),
>
> Thanks so much for your answer.  I probably should have clarified that
> for what I'm attempting to do, I cannot use the opacity of specific
> shapes.  My shapes have to all have an opacity of 1.0, and I need to
> reduce the opacity of the entire shapes overlay at once.
>
> "Why?," you may ask?  I've explained my approach here:http://groups.google.com/group/google-maps-js-api-v3/browse_thread/th...
>
> Any thoughts?
> -Rich
>
> On May 9, 1:28 pm, Radina <radi...@gmail.com> wrote:
>
>
>
> > Related API Reference::
>
> >http://code.google.com/apis/maps/documentation/javascript/reference.h...
>
> > Working example:
>
> > testCircle = new google.maps.Circle({
> >                   center: cTest,
> >                   map: myMap,
> >                   radius: rad, //km
> >                   fillColor: "#3333FF",
> >                   fillOpacity: 0.3,
> >                   strokeColor: "#3333FF",
> >                   strokeOpacity: 0.5
> >       });
>
> > On May 9, 10:59 am, rinogo <ricosu...@gmail.com> wrote:
>
> > > Hello, everyone!
>
> > > I've been trying to figure out how to change the opacity of the shapes
> > > overlay (e.g. circles, squares, polygons, and polylines that can be
> > > drawn on a map).  I've had no success thus far.  Can someone with more
> > > experience shed some light on how this might be accomplished?
>
> > > Thanks so much! :)
> > > -Rich- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages