Android Question webview.loadhtml not working

khwarizmi

Active Member
Licensed User
Longtime User
Hi all

I tried to load this code to load HTML containing google map, But not working:

B4X:
Dim pnlmap As WebView
                        pnlmap.Initialize("")
                        pp.AddView(pnlmap,0,tpp,pp.Width,0.25*Activity.Height)
                        Dim html As String
                        html="<html><body><div class='mapouter'><div class='gmap_canvas'><iframe width='" & pp.Width & "' height='" & (0.25*Activity.Height) & "' id='gmap_canvas' src='https://maps.google.com/maps?q=" & lsslatitude.Get(u) & "%20" & lsslongitude.Get(u) & "&t=&z=9&ie=UTF8&iwloc=&output=embed' frameborder='0' scrolling='no' marginheight='0' marginwidth='0'></iframe><a href='https://www.divi-discounts.com'>pameran pelanggan divi</a></div><style>.mapouter{position:relative;text-align:right;height:500px;width:600px;}.gmap_canvas {overflow:hidden;background:none!important;height:500px;width:600px;}</style></div></body></html>"
                        pnlmap.LoadHtml(html)
 

DonManfred

Expert
Licensed User
Longtime User
1. You are not allowed to use google map in a android browser. At least in your app.
2. You need to use a Api key for the requests of the Javascript google Api.
3. You should use GoogleMaps library to show a Map in Android.
 
Upvote 0
Top