Parsing Google Maps HTML

If you cannot afford 10 grand for an enterprise version of the Google Maps API, then you might be stuck having to parse the html form the clunky old maps.google.com website. If that is the case, here’s a snippet of code that seems to work consistently to parse out the lat and lon from the html.

 If HTML.Length > 0 Then
‘we have something back so
‘get important part of string
Dim s1 As String = geo.Substring(geo.IndexOf(“viewport:{center:{“), 200)
Dim intStartPos As Integer = s1.IndexOf(“{lat:”, 0) + 5
Dim intEndPos As Integer = s1.IndexOf(“}”, intStartPos)
Dim intCommaPos As Integer = s1.IndexOf(“,”, intStartPos)

‘now assign the strings to lat/ lon vars
_lat = s1.Substring(intStartPos, intCommaPos – intStartPos)
_lon = s1.Substring(intCommaPos + 5, intEndPos – (intCommaPos + 5))

End If

, , , , , , , , ,

One Response to Parsing Google Maps HTML

  1. Insurance Lead Generation March 22, 2010 at 4:58 pm #

    I have a question for the community. Most lead providers get their leads from online quote request and then they resell them like 4 or 5 times. I’ve been burned like this a few times already so my question is, how about telemarketing to generate insurance leads? I’ve heard good and bad things so if anyone has any feedback please let me know your thoughts before I spend even more money testing things out.

Leave a Reply