Community of VE/MapPoint Users and Developers
This is a discussion on I was wondering if there was any direct method to .... within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I was wondering if there was any direct method to do reverse geocoding. I have a lat/long and need to ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| |
| |||
|
The snippet below (meant to be used with MapPoint 2002) demonstrates a way how it can done. It creates a location using given lat and lon, and uses the ObjectsFromPoint method of the map object to retrieve a FindResults collection. It then outputs the name of the first (and usually best) hit: <form><textarea wrap="off" readonly="true" name="code" style="BORDER-BOTTOM: gray 1px inset; BORDER-LEFT: gray 1px inset; BORDER-RIGHT: gray 1px inset; BORDER-TOP: gray 1px inset; OVERFLOW: auto; WIDTH: 100%" rows="26" cols="40"> Option Explicit Dim oMpApp As MapPoint.Application Private Sub Command1_Click() ' Attach to running instance of MapPoint Set oMpApp = GetObject(, "MapPoint.Application") ' Retrieve the active map Dim oMap As MapPoint.Map Set oMap = oMpApp.ActiveMap Dim oLoc As MapPoint.Location Set oLoc = oMap.GetLocation(40.778, -124.1827, 1) oLoc.GoTo ' Altitude of 1 and Goto important - better ' results from ObjectsFromPoint Dim Rs As MapPoint.FindResults Set Rs = oMap.ObjectsFromPoint( _ oMap.LocationToX(oLoc), _ oMap.LocationToY(oLoc)) MsgBox Rs.Item(1).Name End Sub </textarea></form> More details and another sample can be found in the documentation of the FindResults object - you'll probably want to check results quality, retrieve alternative hits , and retrieve additional info about the found locations. Note that this is not guaranteed to get you a street address. |
![]() |
| Tags |
| direct, method, wondering |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Direct Mailing Adresses | Anonymous | MapPoint 2006/2009 Discussion | 1 | 05-28-2003 02:45 PM |
| Is it possible to get a direct HANDLE to the Map? .... | Anonymous | MapPoint 2006/2009 Discussion | 2 | 06-19-2002 10:05 AM |
| I am wondering if anyone has built a COM add-in ap.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 05-13-2002 09:55 AM |
| Hello, I'm wondering if there is a way to include.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 09-04-2001 12:52 PM |
| My company was wondering what is the accuracy of y.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 05-11-2001 01:30 PM |