I'm trying to open up an infowindow when I clicking on a polyline, but
when I try to do it, it tells me the "Object doesn't support this
property or method". I created a point about the middle of the
polyline and when I click on the polyline, it opens the infowindow for
this point. The point just has a blank icon so you can't see it.
Here is the code I'm using:
//Create the polyline
var line = new GPolyline([
new GLatLng(46.747213,-120.776852),
new GLatLng(46.746986,-120.776189),
new GLatLng(46.746760,-120.775291),
new GLatLng(46.746596,-120.773763),
new GLatLng(46.746619,-120.772199),
new GLatLng(46.745985,-120.769208),
new GLatLng(46.744469,-120.765353),
new GLatLng(46.743349,-120.763726),
new GLatLng(46.742873,-120.763295),
new GLatLng(46.742457,-120.762731),
new GLatLng(46.742449,-120.762712)
],"#FDD017",6,1);
//Add the polyline to the map
map.addOverlay(line);
//Create a point along the polyline
var point = new GLatLng(46.745985,-120.769208),
var marker = new GMarker(point, polyicon);
//Create the click event for the polyline, open the infowindow for the
point
GEvent.addListener(line,"click",function()
{
marker.openInfoWindowHtml(info);
});
Anyone see what is the problem with the code or how I can do this
differently?
Ray
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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
-~----------~----~----~----~------~----~------~--~---