Posted By

blackf0rk on 03/12/09


Tagged

google maps


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

D4RKCODE


Get Google Maps Coordinates from URL


 / Published in: VB.NET
 

URL: http://codefinds.blogspot.com/2009/02/get-google-maps-coordinates-from-url.html

This function will parse out the Google Maps coordinates from a Google Maps link url like this one: http://maps.google.com/?ie=UTF8&ll=43.068888,-87.978516&spn=23.565589,33.925781&t=h&z=5. The coordinates in this URL are 43.068888,-87.978516.

  1. Public Function GetGeoCoords(ByVal inString As String) As String
  2. Dim Chunks As String()
  3. Dim outString As String = ""
  4. Chunks = Regex.Split(inString, "&")
  5. For Each s As String In Chunks
  6. If InStr(s, "ll") > 0 Then outString = s
  7. Next
  8. Return Replace(Replace(outString, "sll=", ""), "ll=", "")
  9. End Function

Report this snippet  

You need to login to post a comment.