GetPolygone

Re: TWebGMaps

How can I get the Polygon I clicked on as the IdPolygone proves to be un-reliable:

 <DELPHI>

procedure TMyForm.WebGMapsPolygonClickEvent(Sender: TObject;

  IdPolygon: Integer; Button: TMouseButton);

var

  pnt: TPoint;

  PolygonItem: TPolygonItem;

begin

{ IdPolygone is no good as soon as you delete polygons. Say you have 2 polygons and delete the first one (with an Id value of 0), Poly2 (with Id of 1) is still  at 1 (although we now only have 1 Polygon left on-screen). Clicking on the only one remaining will give us IdPolygon of 0 here, but our value that remains is 1?? }

    ShowMessage( IntToStr( IdPolygon ));  //<-- Not the original Id I was expecting

end;

</DELPHI>

Perhaps I am not going about this the right way, if that?s the case, please point me in the right direction. How can I get the TPolygonItem I just clicked on?

Richard