MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Custom location returns null when using find nearby in route

This is a discussion on Custom location returns null when using find nearby in route within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; When using the find nearby method I am having problems retrieving the custom data that I have imported into a ...


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 Thread Tools Display Modes
  #1 (permalink)  
Old 11-29-2004
Junior Member
White Belt
 
Join Date: Nov 2004
Posts: 1
Custom location returns null when using find nearby in route

When using the find nearby method I am having problems retrieving the custom data that I have imported into a MapPoint template. When iterating through the nearby location on a route the location returns null when it hits an imported recorded. All other locations are found.

The Import data is included in the total count and the custom data is found using the interface but not programmatically. I am just interested in finding the custom location on a particular route. Is there a better solution or does anyone know what I am doing wrong? Any help is appreciated. Here is my code.


Code:
oResults = oMap.ActiveRoute.Directions.FindNearby(0.1);
			int i = oResults.Count;
			IEnumerator ienum = oResults.GetEnumerator();
			ienum.Reset();
			//Loop through the enumerator
			while(ienum.MoveNext())
			{
				MapPoint.Location loc = ienum.Current as MapPoint.Location;
				if(loc != null)
				{
					//process the location
					ssCat = loc.Location.PlaceCategory.Name.ToString();
					ssName = loc.Name.ToString();
				}
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 11-14-2005
Junior Member
White Belt
 
Join Date: Nov 2005
Posts: 1
Re: Custom location returns null when using find nearby in r

Quote:
Originally Posted by briansbrown
When using the find nearby method I am having problems retrieving the custom data that I have imported into a MapPoint template. When iterating through the nearby location on a route the location returns null when it hits an imported recorded. All other locations are found.

The Import data is included in the total count and the custom data is found using the interface but not programmatically. I am just interested in finding the custom location on a particular route. Is there a better solution or does anyone know what I am doing wrong? Any help is appreciated. Here is my code.


Code:
oResults = oMap.ActiveRoute.Directions.FindNearby(0.1);
			int i = oResults.Count;
			IEnumerator ienum = oResults.GetEnumerator();
			ienum.Reset();
			//Loop through the enumerator
			while(ienum.MoveNext())
			{
				MapPoint.Location loc = ienum.Current as MapPoint.Location;
				if(loc != null)
				{
					//process the location
					ssCat = loc.Location.PlaceCategory.Name.ToString();
					ssName = loc.Name.ToString();
				}


I know it's been a while, but did you find a solution to this? I am experiencing the same problem with custom imported data. My code is nearly identical to yours - I am getting a "Count" of results, but I can't seem to iterate the results by casting them as Location objects. Any help would be appreciated. keith.mcgill@gmail.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 11-15-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

Code:
MapPoint.Location loc = ienum.Current as MapPoint.Location;
            if(loc != null)
Do you mean this evaluate always to null ? Because in that case there is no Location object in the result set.
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
custom, find, location, nearby, null, returns, route


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
find nearby operation edwong MapPoint Web Service and Virtual Earth 0 10-03-2005 02:41 PM
Find Nearby Places... Labtek MapPoint 2006/2009 Discussion 6 08-16-2004 03:39 AM
Find Places Nearby Tool Anonymous MapPoint 2006/2009 Discussion 0 03-29-2004 11:27 AM
In my application, i am doing a find nearby at a p.... Anonymous MapPoint 2006/2009 Discussion 3 03-03-2004 02:50 PM
Export "Find nearby places" along a route? Anonymous MapPoint 2006/2009 Discussion 4 11-06-2003 10:56 AM


All times are GMT -5. The time now is 07:36 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