-
Posts
159 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Posts posted by Fábio Matte
-
-
When I implemented SweetAlert2 to display a message, the message is opening behind the MainForm form and not where I want it.
I have already added the files / * in the indicated places and everything, but the message still appears behind the MainForm.
And I did exactly as in DEMO.
How could I solve this?
-
1. I am using the Application Form;2. I call the form like this:
Procedure TMainForm.aclFormatExecute (Sender: TObject); Var frmPainel_Fornecedor: TfrmPainel_Fornecedor; Begin FrmPainel_Fornecedor: = TfrmPainel_Fornecedor.Create (UniApplication); FrmPainel_Fornecedor.ShowModal; End;
3. I used the same way, the same DEMO code, I included a UniGMap, and a button to load the code.Button Code:Procedure TfrmPainel_Fornecedor.UniButton1AjaxEvent (Sender: TComponent; EventName: string; Params: TUniStrings); Var AMarker: TMarker; Begin If EventName = 'CurrentPosition' then Begin //UniMemo1.Text: = (EventName + # 13 # 10 + Params.Text); UniGMap1.RemoveAllMarkers; With aMarker Begin Id: = 1; Latitude: = StrToFloat (Params.Values ['lat'], MainForm.fs); Longitude: = StrToFloat (Params.Values ['lng'], MainForm.fs); Title: = 'Here I am!'; Animation: = maNone; Clickable: = True; Draggable: = False; RaiseOnDrag: = False; End; UniGMap1.AddMarker (aMarker, True); End; End; Procedure TfrmPainel_Fornecedor.UniButton1Click (Sender: TObject); Begin UniSession.AddJS ( 'If (navigator.geolocation) {' + 'Navigator.geolocation.getCurrentPosition (function (position) {' + 'AjaxRequest (GeolocationAPIForm.UniButton2, "CurrentPosition",' + '[Lat = "+ position.coords.latitude,' + '"Lng =" + position.coords.longitude,' + '"Acc =" + position.coords.accuracy,' + '"Alt =" + position.coords.altitude,' + '"Altacc =" + position.coords.altitudeAccuracy,' + '"Head =" + position.coords.heading,' + '"Ts =" + position.coords.timestamp' + ']);' + (I.e. '); End;
UniGMap, I did exactly the same settings as DEMO, copied and pasted.It loads the map, but when doing the GeoLocation, the error that I pointed out above in the original message appears.The error was because I did not change the name of the form and the name of the button in the code:Procedure TfrmPainel_Fornecedor.UniButton1Click (Sender: TObject); Begin UniSession.AddJS ( 'If (navigator.geolocation) {' + 'Navigator.geolocation.getCurrentPosition (function (position) {' + 'AjaxRequest (GeolocationAPIForm.UniButton2, "CurrentPosition",' + '[Lat = "+ position.coords.latitude,' + '"Lng =" + position.coords.longitude,' + '"Acc =" + position.coords.accuracy,' + '"Alt =" + position.coords.altitude,' + '"Altacc =" + position.coords.altitudeAccuracy,' + '"Head =" + position.coords.heading,' + '"Ts =" + position.coords.timestamp' + ']);' + (I.E. '); End;
I changed GeolocationAPIForm.UniButton2 by frmPainel_Fornecedor.UniButton1 and it worked correctly.
Tanks
-
Do you create the GeolocationAPIForm as a Free or as Application Form?
How do you call the GeolocationAPIForm ?
Can you provide a working example ?
1. I am using the Application Form;2. I call the form like this:Procedure TMainForm.aclFormatExecute (Sender: TObject); Var frmPainel_Fornecedor: TfrmPainel_Fornecedor; Begin FrmPainel_Fornecedor: = TfrmPainel_Fornecedor.Create (UniApplication); FrmPainel_Fornecedor.ShowModal; End;
3. I used the same way, the same DEMO code, I included a UniGMap, and a button to load the code.Button Code:Procedure TfrmPainel_Fornecedor.UniButton1AjaxEvent (Sender: TComponent; EventName: string; Params: TUniStrings); Var AMarker: TMarker; Begin If EventName = 'CurrentPosition' then Begin //UniMemo1.Text: = (EventName + # 13 # 10 + Params.Text); UniGMap1.RemoveAllMarkers; With aMarker Begin Id: = 1; Latitude: = StrToFloat (Params.Values ['lat'], MainForm.fs); Longitude: = StrToFloat (Params.Values ['lng'], MainForm.fs); Title: = 'Here I am!'; Animation: = maNone; Clickable: = True; Draggable: = False; RaiseOnDrag: = False; End; UniGMap1.AddMarker (aMarker, True); End; End; Procedure TfrmPainel_Fornecedor.UniButton1Click (Sender: TObject); Begin UniSession.AddJS ( 'If (navigator.geolocation) {' + 'Navigator.geolocation.getCurrentPosition (function (position) {' + 'AjaxRequest (GeolocationAPIForm.UniButton2, "CurrentPosition",' + '[Lat = "+ position.coords.latitude,' + '"Lng =" + position.coords.longitude,' + '"Acc =" + position.coords.accuracy,' + '"Alt =" + position.coords.altitude,' + '"Altacc =" + position.coords.altitudeAccuracy,' + '"Head =" + position.coords.heading,' + '"Ts =" + position.coords.timestamp' + ']);' + (I.e. '); End;
UniGMap, I did exactly the same settings as DEMO, copied and pasted.It loads the map, but when doing the GeoLocation, the error that I pointed out above in the original message appears. -
Good Night, I'm trying to make UnigMap work to get the location. I did exactly as in the DEMO example, however Firefox has the following error "ReferenceError: GeolocationAPIForm is not defined", and I can not figure out what is missing. Because in the DEMO being compiled in my machine it works perfectly, however in my APP it does not work appearing the informed message.Can anyone help me if I can?Unigui v1.0.0.1397 is used.
Hide/remove the form border
in General
Posted · Edited by fabiomatte