Problem with ParseStreetAddress
I am using MapPoint 2004 (Italian) with vb.net, I have a problem when parse UK Address
Why my code don’t work only for UK
I put my list box automatically street, postal code, in order to become simpler I put only few result manually in may list box
Italian search and other search (French, Spain , Germany )go , uk don’t go
Why? Why? Why? Why??
thanks in advance to everyone that replay
Code:
Dim oFindResults As MapPoint.FindResults
Dim oLocation As MapPoint.Location
Dim oPushpin As MapPoint.Pushpin
Dim oStreetAddress As MapPoint.StreetAddress
Private Sub mp2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
caricalistbox()
AxMappointControl1.OpenMap("c:\Europa.ptm")
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Dim point1 As String = ListBox1.SelectedItem()
Dim st6 As Object
If rbItaly.Checked = True Then
st6 = MapPoint.GeoCountry.geoCountryItaly
Else
MsgBox("check ITALY button")
Exit Sub
End If
oStreetAddress = AxMappointControl1.ActiveMap.ParseStreetAddress(point1)
Dim a1 As String = oStreetAddress.Street
oFindResults = AxMappointControl1.ActiveMap.FindAddressResults(oStreetAddress.Street, oStreetAddress.City, oStreetAddress.OtherCity, "", oStreetAddress.PostalCode, st6)
oLocation = oFindResults(1)
' oLocation.GoTo()
oPushpin = AxMappointControl1.ActiveMap.AddPushpin(AtLocation:=oLocation, Name:="POINT IT")
oPushpin.BalloonState = MapPoint.GeoBalloonState.geoDisplayBalloon
oPushpin.Symbol = 15
oPushpin.Highlight = True
End Sub
Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged
Dim point2 As String = ListBox2.SelectedItem()
Dim st6 As Object
If RbUK.Checked = True Then
st6 = MapPoint.GeoCountry.geoCountryUnitedKingdom
End If
oStreetAddress = AxMappointControl1.ActiveMap.ParseStreetAddress(point2)
Dim a1 As String = oStreetAddress.Street
oFindResults = AxMappointControl1.ActiveMap.FindAddressResults(oStreetAddress.Street, oStreetAddress.City, oStreetAddress.OtherCity, "", oStreetAddress.PostalCode, st6)
oLocation = oFindResults(1)
' oLocation.GoTo()
oPushpin = AxMappointControl1.ActiveMap.AddPushpin(AtLocation:=oLocation, Name:="POINT UK")
oPushpin.BalloonState = MapPoint.GeoBalloonState.geoDisplayBalloon
oPushpin.Symbol = 15
oPushpin.Highlight = True
End Sub
Function caricalistbox()
ListBox1.Items.Add("Via Nazionale, 00184 Roma RM")
ListBox1.Items.Add("Via Nazionale, 00187 Roma RM")
ListBox2.Items.Add("Green St , London E13 9")
ListBox2.Items.Add("Green Terrace , London E7 0")
ListBox2.Items.Add("Green Terrace , London E7 8 ")
End Function
Re: Problem with ParseStreetAddress
Hi
Can you please tell us what the problem is ? It is difficult to advice if you dont tell it !