fpiette Posted October 9, 2017 Share Posted October 9, 2017 Hello, In the sample Google Maps demo included with uniGUI, I added several markers on the map. Then I add an event listener which do an ajaxRequest against MainForm.UniHTMLFrame1. Then in Delphi code, I handle the event. This works very well. My question is: since the same event is used for several markers, I would like to pass the marker to the event Handler, much like "sender" in Delphi VCL. How to do that ? Excerpt form my code: Javascript: marker.addListener('dragend', function(e) { ajaxRequest(MainForm.UniHTMLFrame1, 'markerDragEnd', ['lat='+e.latLng.lat(), 'lng='+e.latLng.lng()]); } Delphi code (In TMainForm.UniHTMLFrame1AjaxEvent):: if EventName = 'markerDragEnd' then UniLabel1.caption := 'Lat: '+Params.Values['lat'] +', ' + Params.Values['lng']; Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 10, 2017 Share Posted October 10, 2017 Hi, In the sample Google Maps demo included with uniGUI, I added several markers on the map. Then I add an event listener which do an ajaxRequest against MainForm.UniHTMLFrame1. Then in Delphi code, I handle the event. This works very well. My question is: since the same event is used for several markers, I would like to pass the marker to the event Handler, much like "sender" in Delphi VCL. How to do that ? Can you make a simple testcase for this ?! Best regards, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.