Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

Problem with ParseStreetAddress

This is a discussion on Problem with ParseStreetAddress within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am using MapPoint 2004 (Italian) with vb.net, I have a problem when parse UK Address Why my code donít ...

  1. #1
    pippo is offline Junior Member White Belt
    Join Date
    Apr 2005
    Posts
    2

    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

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Problem with ParseStreetAddress

    Hi

    Can you please tell us what the problem is ? It is difficult to advice if you dont tell it !

  3. #3
    pippo is offline Junior Member White Belt
    Join Date
    Apr 2005
    Posts
    2
    Sorry I have a problem when I click on listbox2 in any item.

    When I click on listbox1 in any item. parsestreetaddress parse correctly street, city, and postal code

    example click on listbox1 on item 1, my code return
    oStreetAddress.Street = via nazionale
    oStreetAddress.City= roma
    oStreetAddress.OtherCity,= ďĒ
    oStreetAddress.PostalCode= 00184
    and this is ok

    example click on listbox1 on item 2, my code return
    oStreetAddress.Street = via nazionale
    oStreetAddress.City= roma
    oStreetAddress.OtherCity,= ďĒ
    oStreetAddress.PostalCode= 00187
    and this is ok


    when I click on listbox2 in any item. parsestreetaddress DONíT parse correctly street, city, and postal code

    example click on listbox2 on item 1, my code return
    oStreetAddress.Street = Green St,London E13
    oStreetAddress.City= ďĒ
    oStreetAddress.OtherCity,= ďĒ
    oStreetAddress.PostalCode= 00009
    and this isnít ok

    the street that I parse is Green St, the city is Lodon, the post code is E13 9

    example click on listbox2 on item 2, my code return
    oStreetAddress.Street = Green Terrace,London E7
    oStreetAddress.City= ďĒ
    oStreetAddress.OtherCity,= ďĒ
    oStreetAddress.PostalCode= 0000
    and this isnít ok


    all items of listbox2 donít return information correctly.

    Thanks to you answer

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    I looked at yor code but cannot see some wrong thing in it immediatily. I suggest you make a small console program to demostratewhat's wrong. Chance is bug that you find the bug yourself doing so (I mostly work like that)

    Sorry but it is only advice I can give at moment

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ParseStreetAddress method
    By RP2002 in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 07-01-2003, 11:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96