On Aug 18, 2:27 am, Andrew Leach <[email protected]> wrote:
> On Aug 18, 8:48 am, syed raza <[email protected]> wrote:
>
> > i am trying to change the color of polyline on click but it color
> > option not working resukting in error ... .
>
> > GEvent.addListener(polyline, "click", function()
> > {PolylineOptions({ strokeStyle: new StrokeStyle({color: 0xFF0000})});
>
> No idea what your function PolylineOptions is, but if you don't have
> one this won't work. There doesn't appear to be any reference to the
> polyline which was actually clicked, either.
>
> > i also try this,
>
> > GEvent.addListener(polyline, "click", function()
> > {polyline.setOptions(options: { strokeColor: 'blue' })};
>
> "polyline" may not be the best way of referring to the line within the
> handler function, although it may work depending on scope. However
> "this" inside the handler function will always refer to the object
> which has been clicked, so it's normal to use that.
>
> But I've no idea where you got setOptions and strokeColor from. The
> documentation doesn't mention those.

Those are v3 functions.  Are you using v3? If you had read and
followed the posting guidelines and provided a link to your map that
exhibits the problem we could tell.

The API v3 group is:
http://groups.google.com/group/google-maps-js-api-v3

  -- Larry

>
> http://code.google.com/apis/maps/documentation/javascript/v2/referenc...http://code.google.com/apis/maps/documentation/javascript/v2/referenc...
>
>   GEvent.addListener(polyline, "click", function()
>   {this.setStrokeStyle( { color: '#0000FF' }) };

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to