Julio CEsar
Julio CEsar

Reputation: 1

Working with Delphi GMLib Components and TGMPolygon but non visually using ContainsLocation

GMLib:

Hi, is there a way to execute GMPolygon.Items[0].ContainsLocation(Lat,Long) if GMPolygon is TGMPolygon Object created in runtime but inside a .DLL ? (no visual components nor Form )

I started working with the follow code in Delphi:

WebBrowser:= TWebBrowser.Create(nil);
GMMap:= TGMMap.Create(nil);
GMMap.APIKey:='AIzaSyCjL0m8s-some-key';
GMMap.AfterPageLoaded := AfterLoad;
GMMap.Active:= true;
GMMap.WebBrowser:= WebBrowser;
GMPolygon := TGMPolygon.Create(nil);
GMPolygon.Map:= GMMap;

After populating GMPolygon with 'Add' and creating LinePoints with 'AddLinePoints' from my database I run:

for I:=0 to GMPolygon.Count-1 do
if GMPolygon.Items[I].ContainsLocation(lat,long) then
result:=GMPolygon.Items[I].Tag; 

But this condition never gets 'true'

What can I do?

Upvotes: 0

Views: 457

Answers (0)

Related Questions