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 3 of 3

[VB6 + MP2K] : how to compare 2 locations ???

This is a discussion on [VB6 + MP2K] : how to compare 2 locations ??? within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello, I've got the following code : Code: Dim FR As MapPoint.FindResults Dim PP As MapPoint.Location Set FR = frmMAIN.ctrlMAPPOINT.ActiveMap.FindResults(ADR) ...

  1. #1
    Vincent BENNER's Avatar
    Vincent BENNER is offline Member Yellow Belt
    Join Date
    Sep 2002
    Posts
    44

    [VB6 + MP2K] : how to compare 2 locations ???

    Hello,

    I've got the following code :

    Code:
        Dim FR As MapPoint.FindResults
        Dim PP As MapPoint.Location
        Set FR = frmMAIN.ctrlMAPPOINT.ActiveMap.FindResults(ADR)
        If FR.ResultQuality = 2 Then
    
            ' I need to compare FR.Item(1) and FR.Item(2)
    
        End If
    I'd like to know if the first Item is the same than the second one !

    Is this possible ???

    King regards,

    Vincent BENNER

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Maybe you need to convert the Location object in lat/long coordinates and then compare the lat/long coords.

    http://www.mp2kmag.com/articles.asp?ArticleID=9

    Dominic Morin, MCP
    dominic.morin@optimarketing.com

  3. #3
    Vincent BENNER's Avatar
    Vincent BENNER is offline Member Yellow Belt
    Join Date
    Sep 2002
    Posts
    44

    I've found a solution !

    Hello,

    I think I found a solution. But I don't know if it's the best one !

    I just wrote this code to complete my test :

    Code:
        Dim XX As Double
        Dim YY As Double
        Dim PP As MapPoint.Location
        Dim FR As MapPoint.FindResults
    
        Set FR = frmMAIN.ctrlMAPPOINT.ActiveMap.FindResults(ADR)
        If FR.ResultsQuality = geoFirstResultGood Then
            Set PP = FR.Item(1)
            Call CalcPos(frmMAIN.ctrlMAPPOINT.ActiveMap, PP, XX, YY)
            StrXX = Replace(Format$(XX, "0.0000"), ",", ".")
            StrYY = Replace(Format$(YY, "0.0000"), ",", ".")
            ' Return TRUE here
            Exit Function
        ElseIf FR.ResultsQuality = geoAmbiguousResults Then
            If FR.Item(1).StreetAddress = FR.Item(2).StreetAddress Then
                Set PP = FR.Item(1)
                Call CalcPos(frmMAIN.ctrlMAPPOINT.ActiveMap, PP, XX, YY)
                StrXX = Replace(Format$(XX, "0.0000"), ",", ".")
                StrYY = Replace(Format$(YY, "0.0000"), ",", ".")
                ' Return TRUE here too
                Exit Function
            End If
        End If
    ' Return FALSE here or make other tests...



    I hope it can help other programmers !

    Regards,

    Vincent BENNER

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How does MapPoint compare to other GIS products?
    By tacaldo in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-24-2005, 08:43 AM
  2. [VB6 + MP2K] : how to know that...
    By Vincent BENNER in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-21-2003, 05:13 AM
  3. I am considering using MP2K , i have lat/long data....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 08-21-2002, 10:01 AM
  4. With MP2K does anyone know how to programatically ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-29-2002, 07:19 AM
  5. Hi I am currenlty trying MP2K, I have one problem ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-19-2001, 05:59 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