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

street address from lat/lon... VB style

This is a discussion on street address from lat/lon... VB style within the MapPoint Desktop Discussion forums, part of the Map Forums category; Like an earlier post, I need to derive the street address from the Lat/Lon coordinates on a map. However, I ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    street address from lat/lon... VB style

    Like an earlier post, I need to derive the street address from the Lat/Lon coordinates on a map. However, I am strictly a VB kinda guy, and C# is just Greek to me.

    MapPoint has this neat feature where you can click on a street and the street address will just pop right up. Is there no means for just programmatically utilizing this function with the MapPoint VB control? I've worn out my eyes and fingers looking for a way to do this. Since the functionality is there within MapPoint, it seems like it ought to be available.

    Any help will be greatly appreciated.

  2. #2
    ChetCromer is offline Junior Member White Belt
    Join Date
    Apr 2005
    Posts
    2
    I know this answer is out there, because I found it once and use it quite a bit. I wrote code that automatically displays the current address in a label as you move the mouse over the map.

    Don't have time to get to it today, but if you don't get an answer, email me at chet@chetcromer.com and I'll help you out.

    Chet

  3. #3
    SimonPearse is offline Junior Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    15
    here is some code i use in vb5/6. as the mouse is moved around the map the Lat (lblLat), Lon (lblLon) and address (lblWhere) are displayed

    Private Sub ctlMap_MouseMove(ByVal button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
    Dim objMouseLoc As mappoint.Location
    Dim objMouseResults As mappoint.FindResults
    Dim latlon As LatLonType
    Dim index As Integer

    Set objMouseLoc = objCallMap.XYToLocation(X, Y)
    If Not objMouseLoc Is Nothing Then
    latlon = calcpos(objCallMap, objMouseLoc)
    lblLat.caption = Format(latlon.Lat)
    lblLon.caption = Format(latlon.Lon)

    Set objMouseLoc = Nothing
    Set objMouseResults = objCallMap.ObjectsFromPoint(X, Y)
    lblWhere = ""
    If objMouseResults.count > 0 Then

    If Not (objMouseResults.item(1).Location.StreetAddress) Is Nothing Then
    lblWhere = "Mouse is at: " & objMouseResults.item(1).Location.StreetAddress.Str eet
    Else
    lblWhere = ""
    End If

    Else
    lblWhere(1) = ""
    End If
    Set objMouseResults = Nothing
    End If
    Exit Sub

    My 'Calcpos' routine is based on the Calcpos routine found in the articles section of this site. It returns LatLon from a mappoint location. I modified it to use a typed variable LatLon

    Public Type LatLonType
    Lat As Double
    Lon As Double
    H As Double
    End Type

  4. #4
    johnweidauer is offline Junior Member White Belt
    Join Date
    Feb 2004
    Posts
    8

    your CalcPos code

    can you provide a link to your CalcPos variation or can you post it?

    Thanks,

    John

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Mapping Southern Ireland Street Address
    By Yazzy in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 01-15-2006, 04:02 PM
  2. Has anyone got street address with MapPoint Euro 2004?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 02-09-2005, 09:13 AM
  3. Getting 'second' street address
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-06-2004, 10:31 AM
  4. GeoRoadType from Street Address
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 01-25-2004, 06:22 AM
  5. street address limit
    By bob in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 11-04-2003, 08:51 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