That is because of the object infoWindow is stored in
myDirectionsRenderer,the object listened.
and in my practice, 'this' in the callback function will be equal to
the object listened.
isn't it?
On 11月17日, 上午11時21分, Chris Broadfoot <
c...@google.com> wrote:
> Also, note in the context of an event listener, that 'this' is probably not
> the 'this' you're looking for.
>
> On Wed, Nov 17, 2010 at 10:35 AM,
geocode...@gmail.com <
geocode...@gmail.com
>
>
>
>
>
>
>
> > wrote:
> > On Nov 15, 10:46 pm, achick <
achick...@gmail.com> wrote:
> > > I want to show a infoWindow when user click the route on map,
> > > I had tried addListener on DirectionsRenderer and DirectionsRoute but
> > > not work,
>
> > You need to add a click listener to the polyline if you want it to
> > respond to clicks. The only way I know to do that is to use the
> > suppressPolylines option and draw it yourself.
>
> > One of my examples which does that:
> >
http://www.geocodezip.com/v3_directions_custom_iconsC.html
>
> > > here is my code:
>
> > Not helpful. A link to your map might be.
>
> > -- Larry
>
> > > Thanks.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > To post to this group, send email to
> >
google-map...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B
unsub...@googlegroups.com>
> > .