Cycl0ps wrote:Hello,
Im trying to make an application like Layar, now im comming to the hardest part of the coding.
I want can get my GPS coordinates and can call the GPS coordinates of the locations I want to find.
Now Im searching for an way to put this together to get the following things.
1). The distance between the 2 locations.
2). The angle/degree to where the location is.
If you got some code for this please explain this, Or if you got other suggestions/links feel free to post them.
Any help would be welcome. If I find something myself Ill post it here also.
How to calculate the distance between two GPS coordinates (I found this code but how can I use this?)
Kind regards,
Cycl0ps
p.s: Im an starting java dev, so please bear with me.
p.s.s: Sorry about my bad english.
You can use this code to get latitude and longitude.
Public Function fgGetLatAndLongUsingAddress(sAddress As String) As String
'This function works best with a complete address including the zip code
Dim sResponseText As String, sReturn As String
sReturn = "none"
Dim objHttp As Object, sQuery As String
sQuery = "http://rpc.geocoder.us/service/csv?address=" & Replace(sAddress, " ", "+")
Set objHttp = CreateObject("Msxml2.ServerXMLHTTP")
objHttp.Open "GET", sQuery, False
objHttp.send
sResponseText = objHttp.ResponseText
gsLastLatLongResponseText = sResponseText
Set objHttp = Nothing
If Len(sResponseText) > 0 Then
If InStr(sResponseText, "Bad Request") > 0 Then
'Do Nothing
ElseIf InStr(sResponseText, "couldn't find this address") > 0 Then
'Do Nothing
Else
If InStr(sResponseText, vbCrLf) > 0 Then
'We got more than one result
End If
If InStr(sResponseText, ",") > 0 Then
Dim aryInfo() As String
aryInfo = Split(sResponseText, ",")
sReturn = aryInfo(0) & "," & aryInfo(1)
End If
End If
End If
fgGetLatAndLongUsingAddress = sReturn
End Function
Might be useful for you.