On Sep 5, 12:47 pm, ss ss <[email protected]> wrote:
> Dear Rossko,
> Ok I have tried this code but it does not work either
> and I notice is that the "click" is not trigger cause in that function I got
> an alert to check for it. Must I tie openInfoWindow with anything or can it
> open by itself.
your GMap2 object.
>Another thing I want the inforwindow to open the centre of
> the polygon?
Then calculate that point and use that instead of the first vertex
>thank you.
> GEvent.trigger(poly,"click");
> GEvent.addListener(poly, "click", function()
> {
> alert("clicked event");
> var htmlString = "<font color=\"#6387A5\"
> size=\"1\"face=\"Verdana, Arial, Helvetica, sans-serif\">" +
> "Vehicle ID : <br/>"+
> "Location : <br/>"+
> "Speed : <br/>"+
> "Bearing : <br/>"+
> "Date Timer : <br/>"+
> "</font>";
> var latLong = poly.getVertex(0);
> openInfoWindow(latLong,"",htmlString);
should be map.openInfoWindow
-- Larry
> });
>
>
>
> On Mon, Sep 6, 2010 at 12:22 AM, Rossko <[email protected]> wrote:
> > > Attach is my link for thehttp://
> > gamtrack.com.my/sample1/basic.php. Ok then can you just try to draw
> > > the polygon then you se my problem why is it not appearing the window.
>
> > you have the line
> > poly.openInfoWindowHtml(htmlString);
> > 'poly' is a GPolyline and does not have a openInfoWindowHtml() method,
> > so it won't work.
>
> > You could instead open an infowindow somewhere on the map
>
> >http://code.google.com/apis/maps/documentation/javascript/v2/referenc...
> > and you could choose 'somewhere' to be the position of the mouse, or
> > click, or the last vertex of the poly, or the centre of the bounds of
> > the poly, or wherever you choose.
>
> > --
> > 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]<google-maps-api%2Bunsubscribe@
> > googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-maps-api?hl=en.
--
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.