This is looking good MOnline! Is the interface hardcoded or using a skin interface?
Sorry for the late reply MOnline but here's the promised example (actually it's the full function):
This function returns an string array with the house numbers.
It's by no means perfect since it doesn't always match the actual street but it will give a pretty good estimate. But it only searches for 400 numbers. I figured I didn't need it any higher since no streets around here are longer. If you want it longer just change the 400 number to what you want. But be aware that this will require som more processing time.
Code:
Public Function Dest_GetNumbers(Target As DestPoint) As String()
Dim Latitude, Longitude As Double
Dim House() As String
Dim HouseNumber As Integer
Dim ArrayIndex As Integer
Dim ConsecutiveHits As Integer
Dim DestPointData As DestPoint
Set DestPointData = New DestPoint
With Target
DestPointData.City = .City
DestPointData.Description = .Description
DestPointData.House = .House
DestPointData.Latitude = .Latitude
DestPointData.Longtitude = .Longtitude
DestPointData.Street = .Street
DestPointData.Telephone = .Telephone
DestPointData.Zip = .Zip
End With
Call Dest2.GetCoordinatesFromAddress(DestPointData)
Latitude = DestPointData.Latitude
Longitude = DestPointData.Longtitude
ArrayIndex = 0
ConsecutiveHits = 0
ReDim House(0)
For HouseNumber = 1 To 400
DestPointData.House = HouseNumber
Call Dest2.GetCoordinatesFromAddress(DestPointData)
If (Longitude <> DestPointData.Longtitude) Or (Latitude <> DestPointData.Latitude) Then
If House(0) <> "" Then ReDim Preserve House(UBound(House) + 1)
House(ArrayIndex) = HouseNumber
ArrayIndex = ArrayIndex + 1
ConsecutiveHits = 0
End If
If (Longitude = DestPointData.Longtitude) And (Latitude = DestPointData.Latitude) Then
ConsecutiveHits = ConsecutiveHits + 1
If ConsecutiveHits >= 10 Then
HouseNumber = 400
End If
End If
Latitude = DestPointData.Latitude
Longitude = DestPointData.Longtitude
DoEvents
Next HouseNumber
Dest_GetNumbers = House
Set DestPointData = Nothing
End Function
As for the speed I used the GPS data. If you do some searching on google you'll find lots of info about this GPS data string. But to get you started, here's the one you need to work with:
Code:
String: $GPRMC,<1>,<2>,<3>,<4>,<5>,<6>,<7>,<8>,<9>,<10>,<11><CR><LF>
Data:
1) UTC time of position fix, hhmmss.sss format.
2) Status, A = data valid, V = data not valid.
3) Latitude, ddmm.mmmm format.
4) Latitude hemisphere, N or S.
5) Longitude, dddmmm.mmmm format.
6) Longitude hemisphere, E or W.
7) Speed over ground, 0.0 to 1851.8 knots. <---- THIS IS THE ONE
8) Course over ground, 000.0 to 359.9 degrees, true.
9) Date, ddmmyy format.
10) Magnetic variation, 000.0 to 180.O.
11) Degrees
12) Checksum.
Hope this helps.
If you have any more questions feel free to ask, I just completed an early but working version of my own frontend (using plugins for winamp control, powercontrol of the laptop and destinator).
Btw: Go with a plugin interface as early in the stage as possible. This will really make your frontend a LOT faster if done correctly.
Cheers
Borte
Bookmarks