CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Marker ID in mouse marker events

by FredT » 10 May 2019 10:40

Hi,

In a map I have several markers of which I have defined the ID.
I need to recover these ID during events: MarkerEventsMouseDown, MarkerEventsDragEnd and MarkerEventsMouseOver.
I get it only on the event MarkerEventsMouseOver.
It is not part of events params for MarkerEventsMouseDown, MarkerEventsDragEnd.
What I can get for MarkerEventsMouseDown, MarkerEventsDragEnd is an IntId, which does not match my ID and I do not know what to do; because when I finish drag and drop a marker I need his ID to perform treatments.

ex: For my marker ID: 'A1' , i have IntId = 'autoid1557426726-1'
For my marker ID: 'B1' , i have IntId = 'autoid1557425483-2'

How to get the markers ID for MarkerEventsMouseDown and MarkerEventsDragEnd events?

Thank you
FredT
 
Posts: 28
Joined: 28 Jan 2019 15:10

by Alexander Bulei » 13 May 2019 09:50

Hi FredT,
Are you using the gmap or gmap3?

Btw, you can find the example of drag end (GetAddressMarkerDragEndEvent).

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3506
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by FredT » 14 May 2019 09:15

Hi,

I use GMap3.

In the example GetAddressMarkerDragEndEvent we get Latitude and Longitude not the ID.

I was able to recover an intID like this, but it does not match my ID:

with IWCGJQGMap3.JQGMapV3Options.Marker.Events.OnDragEnd.BrowserParams.Add do
begin
ServerName := 'IntId';
BrowserScript := 'marker.intId';
end;
IWCGJQGMap3.JQGMapV3Options.Marker.Events.OnDragEnd.OnEvent:= MarkerEventsDragEnd;

Thank.
FredT
 
Posts: 28
Joined: 28 Jan 2019 15:10

by assapan » 14 May 2019 16:20

Hi,
In Gmap3.Marker property set
Code: Select all
    Marker.Events.OnClick.OnEvent := MarkerClick;
    with Marker.Events.OnClick.BrowserParams.Add do
    begin
      ServerName := 'markerid';
      BrowserScript := 'arguments[2].id';
    end;


in markerclick event
Code: Select all
procedure TCarteManager.MarkerClick(Sender: TObject; AParams: TStringList);
var
  id: string;
begin
  id := AParams.Values['markerid'];
  AfficheStation(X);
end;
Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

by FredT » 15 May 2019 09:39

Super

Thank you Assapan
FredT
 
Posts: 28
Joined: 28 Jan 2019 15:10


Return to JQGMap

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.