Page 1 of 1

Get Lat Lng on Map.Events.OnClick

PostPosted: 15 May 2019 15:29
by FredT
Hi,

I want to add a marker when the user clicks on GMap3.
Looking at the available settings (through the Developer Console browser & debugger command), I do not find how to retrieve Lat Lng coordinates from the OnClick Params.

Which are the params to add ?

with IWCGJQGMap3.JQGMapV3Options.Map.Events.OnClick.BrowserParams.Add do
begin
ServerName := ???
BrowserScript := ???
end;
IWCGJQGMap3.JQGMapV3Options.Map.Events.OnClick.OnEvent := MapEventsClick;

Thank.

Re: Get Lat Lng on Map.Events.OnClick

PostPosted: 31 May 2019 12:39
by Alexander Bulei
Hi FredT,

Sorry for the delay...

Here you have the code:

delphi code
with IWCGJQGMap3.JQGMapV3Options.Map.Events.OnClick.BrowserParams.Add do
begin
ServerName := 'lat';
BrowserScript := 'arguments[1].latLng.lat()';
end;
with IWCGJQGMap3.JQGMapV3Options.Map.Events.OnClick.BrowserParams.Add do
begin
ServerName := 'lng';
BrowserScript := 'arguments[1].latLng.lng()';
end;


Best Regards.