MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




FindNearBy Not Returning Address

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (5) Thread Tools Display Modes
  5 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 01-25-2007
Junior Member
White Belt
 
Join Date: Jan 2007
Posts: 1
FindNearBy Not Returning Address

Hello,

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 radius
oFR = oLocLatLong.FindNearby(3)
I then run through a loop like this:

ForEach oLocFR In oFR

and 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-25-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
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;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
address, findnearby, returning


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/findnearby-not-returning-address-5619.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 12:40 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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