B4J Question Webview problem

menneaduplo

Member
Licensed User
Longtime User
If I try to load the simple attached map.html file into a B4J webview this doesn't work.
With any browser, yes.
The html file contains an OpenStreetMap map with scripts.
Can anyone help me?
Thanks in advance.

My Code

My Code:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private xui As XUI
    Private Button1 As B4XView
    Private WebView1 As WebView
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("main")
    Dim S As String
    S=File.ReadString(File.DirApp,"map.html")
    WebView1.LoadHtml(S)
    MainForm.Show
End Sub
 

Attachments

  • map.zip
    798 bytes · Views: 136

Erel

B4X founder
Staff member
Licensed User
Longtime User
1676556359163.png


B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    WebView1.LoadUrl(xui.FileUri("C:\Users\H\Downloads\map.html", ""))
End Sub

I've tested with OpenJDK 14 (download from forum)
 
Upvote 0
Top