fpiette Posted October 9, 2017 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
Sherzod Posted October 10, 2017 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
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.