Community of VE/MapPoint Users and Developers
This is a discussion on FindNearBy Not Returning Address within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello, I am trying to locate POI's within a 3 mile radius of a location. I seem to be able ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| FindNearBy Not Returning Address I am trying to locate POI's within a 3 mile radius of a location. I seem to be able to locate them, but, I only get their Lat/Long & Name, I can't seem to pull out the address as well. Here is a snippet of what I am doing: oLocLatLong = objMap.GetLocation(iLat, -iLong) 'Get the POIs within 3 mile radiusI then run through a loop like this: ForEach oLocFR In oFRand try and pull out the address. It's always empty. Any thoughts? I'd be happy to share more of my code if that will help. Thanks, Dale |
| |||
| Re: FindNearBy Not Returning Address
Hi Dale, You should have addrsses too. Here is a code snippet of experimental program that returns a lots of addresses: Code: Map map = MP.ActiveMap;
Location loc = map.GetLocation(51, 4, 1);
Pushpin pp = map.AddPushpin(loc, "");
FindResults nearby = pp.Location.FindNearby(10);
foreach (object o in nearby) {
if (o is Pushpin) {
pp = (Pushpin)o;
Console.WriteLine("Pushpin");
}
else if (o is Location) {
loc = (Location)o;
if (loc.StreetAddress != null) {
if (loc.StreetAddress.PostalCode != "" && loc.StreetAddress.City != "") {
Console.WriteLine("We have an address");
Console.WriteLine("street " + loc.StreetAddress.Street);
Console.WriteLine("postcode " + loc.StreetAddress.PostalCode);
Console.WriteLine("city " + loc.StreetAddress.City);
Console.WriteLine("country " + loc.StreetAddress.Country);
Console.WriteLine("---");
}
else {
FindResults streets = map.ObjectsFromPoint(map.LocationToX(loc), map.LocationToY(loc));
foreach (object O in streets) {
Location streetLoc = O as Location;
if (streetLoc != null && streetLoc.StreetAddress != null) {
Console.WriteLine("Found " + streetLoc.StreetAddress.Value);
break;
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| address, findnearby, returning |
| ||||
| Posted By | For | Type | Date | |
| MapPoint Articles - MP2K Magazine | This thread | Refback | 02-02-2007 02:40 PM | |
| Determing the Time Zone in MapPoint - MapPoint Articles - MP2K Magazine | This thread | Refback | 02-01-2007 03:09 PM | |
| Wider Code Boxes - vBulletin Community Forum | This thread | Refback | 01-30-2007 01:32 PM | |
| Map Visitors - Powered by Virtual Earth | This thread | Refback | 01-28-2007 04:23 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 01-28-2007 06:40 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What does it mean if FindAddress is returning null? | chance1166 | MapPoint Web Service and Virtual Earth | 0 | 01-12-2006 12:29 PM |
| Returning results from ShowFindDialog | mbdunkin | MapPoint 2006/2009 Discussion | 3 | 08-15-2005 10:39 PM |
| Returning your Lat/Long in mappoint | Anonymous | MP2K Magazine Articles | 1 | 02-01-2005 07:54 PM |
| Returning the Latitude & Longtitude in VBA | Anonymous | MapPoint 2006/2009 Discussion | 0 | 10-20-2004 05:24 AM |
| Is MapPoint capable of programatically returning a.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 07-18-2002 05:27 AM |