googlemap trouble

marcick

Well-Known Member
Licensed User
Longtime User
I'm doing some experiments with googlemap looking to some examples in this website Google Maps API links
I load an example in a browser on the pc, for example this one:

Google Maps JavaScript API v3 Example: Complex Icons

I caputure the source code and put it in a text file "gmapSample.txt".
I transfer the text files on android device, then I try to run this simple application:

Dim Mymap as WebView
Dim HC as string
Dim List1 as List
Dim s as string
Dim hc as string

hc=""
List1 = File.ReadList(File.DirRootExternal, "gmapsample.txt")
For i = 0 To List1.Size - 1
s= List1.Get(i)
hc=hc & s
Next

mymap.LoadHtml(Hc)


I see a blank webpage, not the map as I see it on the PC.
This method work with simpler files, like this "hello world tutorial" :

Google Maps Javascript API V3 Tutorial - Google Maps JavaScript API V3 - Google Code

bou doesn't work with more complicated files.

Are there some mistakes ? Or are there some limitations in googlemap integration with b4a ?

Thanks
Marco
 

marcick

Well-Known Member
Licensed User
Longtime User
Yes Erel, I saw those examples and they works.
But if I try a complex example captured from googlemap, with more interesting functiions (multiple markers, automatic zoom to fit bounds and other stuff), I can't see it working.
There are many interesting examples in googlemap at that link. You choose a layout that fit your needings, capture the source code and execute in a webView. In theory ...
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Found why doesn't work ..
I have to add a CrLf after each line I read from the file

For i = 0 To List1.Size - 1
s= List1.Get(i)
hc=hc & s & CrLf

Thanks
Marco
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…