Dear Larry,
Ok I have modified as you said now as below. The problem
when I replace the map.getCenter() with point the window does not appear can
you tell me what is wrong with my var point = new
GLatLng(poly.getVertex(0));. Is it I have to swap between the lat and long
is it ? Thank you.
var point = new GLatLng(poly.getVertex(0));
//var latLong = poly.getVertex(0);
map.openInfoWindow(map.getCenter(),htmlString);
On Mon, Sep 6, 2010 at 3:55 AM, [email protected]
<[email protected]>wrote:
> On Sep 5, 1:47 pm, ss ss <[email protected]> wrote:
> > Dear Larry,
> > You can find it herehttp://
> www.gamtrack.com.my/sample1/basic.php. Just draw the polygon you
> > will know then. Thank you.
>
> The infowindow is working for me (no contents though...)
>
> This looks wrong:
> map.openInfoWindow(latLong,"",htmlString);
>
> What do you think is the second argument of GMap2.openInfoWindow? For
> that matter why aren't you using openInfoWindowHtml?
>
> -- Larry
>
> >
> > On Mon, Sep 6, 2010 at 1:40 AM, [email protected]
> > <[email protected]>wrote:
> >
> >
> >
> > > On Sep 5, 1:36 pm, ss ss <[email protected]> wrote:
> > > > Dear Larry,
> > > > No luck even I put this map.openInfoWindow it does not
> > > appear
> > > > too. The problem it is not even triggerred as I have not seen the
> alert
> > > > being pop-up as my part of the code below:
> >
> > > > GEvent.trigger(poly,"click");
> > > > GEvent.addListener(poly, "click", function()
> > > > {
> > > > alert("clicked event");
> >
> > > Then where is the map that shows the problem?
> >
> > > -- Larry
> >
> > > > On Mon, Sep 6, 2010 at 1:25 AM, [email protected]
> > > > <[email protected]>wrote:
> >
> > > > > 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%[email protected]>
> <google-maps-api%2Bunsubscribe@ googlegroups.com>
> > > <google-maps-api%2Bunsubscribe@ googlegroups.com>
> > > > > <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]<google-maps-api%[email protected]>
> <google-maps-api%2Bunsubscribe@ googlegroups.com>
> > > <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]<google-maps-api%[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]<google-maps-api%[email protected]>
> .
> 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.