On 2 November 2010 14:56, xelawho <[email protected]> wrote: > > but does this not mean that I can just link to the polylines by pre- > defining their numbers like this: > <a href='javascript:GEvent.trigger(gpolylines[2],"click");'>Blue line</ > a> > > (obviously not, because it doesn't work - I get an "a is undefined" > error when I click on the link) > > I'm obviously missing something fundamental?
When you click, the link, you trigger an event without a location, so you catch that with !pts and calculate the desired point instead: if (!pts) point = poly.getVertex(Math.floor(poly.getVertexCount()/2)); And then you use pts which you haven't got. map.openInfoWindowHtml(pts,html); It would be better to redefine pts if it's invalid, so you can always use it: if (!pts) pts = poly.getVertex(Math.floor(poly.getVertexCount()/2)); map.openInfoWindowHtml(pts,html); -- 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.
