我開發了一個應用程序來讀取windows phone 7上兩個位置之間的距離。但是,在測試應用程序時,無論何時移動幾釐米,它都會以13000的值提供值。在計算通過Windows Phone的釐米距離時遇到問題
Public Sub watcher1_PositionChanged(sender As Object, e As GeoPositionChangedEventArgs(Of GeoCoordinate))
Dim dCoord As GeoCoordinate
Dim currentDistance As Double
Dim convertedDistance As Double
dCoord = New GeoCoordinate(e.Position.Location.Latitude, e.Position.Location.Longitude)
If mlastCoordinate.Latitude <> 0.0 Then
'distanceText.Text = e.Position.Location.Latitude.ToString()
currentDistance = mlastCoordinate.GetDistanceTo(dCoord)
mDistance = startCoordinate.GetDistanceTo(dCoord)
' mDistance += currentDistance
'mDistance = Math.Round(mDistance, 2)
'Dim distance As String
'distance = String.Format("%.2", mDistance)
If selectedSystemState.Equals("centi") Then
convertedDistance = mDistance * 100
ElseIf selectedSystemState.Equals("meter") Then
convertedDistance = mDistance
ElseIf selectedSystemState.Equals("inches") Then
convertedDistance = mDistance * 39.37
ElseIf selectedSystemState.Equals("feet") Then
convertedDistance = mDistance * 3.28
End If
convertedDistance = Math.Round(convertedDistance, 2)