Google Maps API vs. Library

pixelpop

Active Member
Licensed User
Longtime User
I have searched the forum and there are some fantastic things being done with Google Maps library. At some point I may jump into those deep waters, but for now I am just trying to display a Google map in a webview using LoadUrl. I don't need plotting, navigation or GPS as I will be passing coords to the URL myself. I tried this:

B4X:
Activity.LoadLayout("wv")
webview1.Initialize(Me)
webview1.LoadUrl("http://maps.googleapis.com/maps/api/staticmap?center=37.58,-87.6&zoom=14&size=400x400&sensor=false")

but I just get a white square. But something is happening because I get vertical and horizontal scrolling and the zoom +/- button.

So I have two questions: how do I get the map to display and how do I get a marker (standard marker, no label) to display at the provided coordinates?
 

pixelpop

Active Member
Licensed User
Longtime User
OK, I got the marker issue resolved.But I still just get a white webview when this Url is loaded:

B4X:
Activity.LoadLayout("wv")
webview1.Initialize("webview1")
webview1.LoadUrl("http://maps.googleapis.com/maps/api/staticmap?center=40.664167,-73.938611&zoom=12&size=400x400&maptype=roadmap&markers=size:medium%7Ccolor:blue%7C40.664167,-73.938611&sensor=False")

This URL displays the map properly in IE. Any ideas?

Resolved: I created the webview in designer and then intialized it in code. Removing the initialization solved the problem.
 
Last edited:
Upvote 0
Top