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

FindNearBy Not Returning Address

This is a discussion on FindNearBy Not Returning Address within the MapPoint Desktop 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 ...

  1. #1
    ddasker is offline 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

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. What does it mean if FindAddress is returning null?
    By chance1166 in forum Bing Maps and MapPoint Web Service
    Replies: 0
    Last Post: 01-12-2006, 12:29 PM
  2. Returning results from ShowFindDialog
    By mbdunkin in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-15-2005, 10:39 PM
  3. Returning your Lat/Long in mappoint
    By Anonymous in forum MP2K Magazine Articles
    Replies: 1
    Last Post: 02-01-2005, 07:54 PM
  4. Returning the Latitude & Longtitude in VBA
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 10-20-2004, 05:24 AM
  5. Is MapPoint capable of programatically returning a....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-18-2002, 05:27 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