Google Maps Webview Help

Ksmith1192

Member
Licensed User
Longtime User
Hi Guys, I am using the code from this thread to create a Google Maps Marker on a Webview. From this code, it creates the webview from code, and I want to add a couple more items with the designer. How do I modify it to Load a layout and use my own Webview from the designer. How should I go about doing it?

Here is the code from the original app.
B4X:
   PosLat.Initialize
   PosLong.Initialize
   
   PosLat.Add(46.1348)
   PosLong.Add(7.1132)
   PosLat.Add(46.1364)
   PosLong.Add(7.1122)
   PosLat.Add(46.1380)
   PosLong.Add(7.1152)
   PosLat.Add(46.1386)
   PosLong.Add(7.1147)
   PosLat.Add(46.1395)
   PosLong.Add(7.1170)
   PosLat.Add(46.1409)
   PosLong.Add(7.1189)
   
   MapWebView.Initialize("")
   Activity.AddView(MapWebView,0,0,100%x,100%y)
   
   ShowMap(46.1370, 7.1164, 15, True, True, True, "TOP_LEFT", True, PosLat, PosLong, True, True, "#ff0000", 0.5, 3)
End Sub



http://www.b4x.com/forum/basic4andr...s/9005-googlemaps-v3-webview-2.html#post50392
 

klaus

Expert
Licensed User
Longtime User
Change the code from:
B4X:
MapWebView.Initialize("")
Activity.AddView(MapWebView,0,0,100%x,100%y)

ShowMap(46.1370, 7.1164, 15, True, True, True, "TOP_LEFT", True, PosLat, PosLong, True, True, "#ff0000", 0.5, 3)
to
B4X:
Activity.LoadLayout("Main")
    
ShowMap(46.1370, 7.1164, 15, True, True, True, "TOP_LEFT", True, PosLat, PosLong, True, True, "#ff0000", 0.5, 3)
Where Main is name of the layout file.

You could also have a look at the GPSExample program there is a more elablorated routine in there.

Best regards.
 
Upvote 0
Top