Labtek
05-16-2003, 03:24 PM
In the MapPoint application (not the MapPoint control) a user can right click on a pushpin (or route) and select "Find Nearby Places...". The user can then see a list of nearby places and select a radius. On the map the user will see the search radius. This search radius looks exactly the same as the search radius you get when you use the FindNearby method in a COM object. FindNearby returns a FindResults collection. Does this mean the when the user selects "Find Nearby Places..." that somewhere within the application FindResults collection is created? If so has anyone figured out how to access it? I've been looking all though the object model documentation looking for some kind of "CurrrentFindResults" property or something like that... I've had no luck. Anyone else?
Nostradamus
08-10-2004, 09:30 AM
I've got the same problem. Need help quickly!
Eric Frost
08-10-2004, 11:12 AM
You can Dim a FindResults collection.. it's an object.
Check the code in this article:
http://www.mp2kmag.com/a53--poi.points.interest.mappoint.html
In particular, see the line here.. the FindNearby results are assigned to a FindResults object?
'Get the POIs within 50 mile radius
Set oFR = oLocLatLong.FindNearby(50)
Hope this helps,
Eric
Nostradamus
08-12-2004, 07:43 AM
Not quite the way I wanted to do it, but it helped me anyway.
Thx alot
:D
Eric Frost
08-12-2004, 08:02 AM
The object model is not always very intuitive.. how did you want to do it?
Eric
Nostradamus
08-12-2004, 08:36 AM
Ok, I read in a list of customers, locate them on the map and put them on the map as a new PushPin DataSet, containing all the necessary informations for my purpose. So far everything just works fine for me. The next step would be that the user can right-click on one of these PushPins and select "Find nearby places" from the context menu on the map. The Find Nearby places search dialog of MapPoint pops up on the left side of the MapPoint control and you can specify the search radius. And here is what it want: When this search is done, a new PushPin DataSet is created which contains all the PushPins in the given radius. I now want to access this SearchResult DataSet to read out the customer information of these pushpins. I don't want to do the search within my Application.
My current solution to this problem is that I show a new form in which you have to enter the customer's name and the search radius. My App then looks for this pushpin and makes a FindNearby() query and I use this FindResult to extract the information from the found PushPins. This has two disadvantages: In my Application it can happen, that two or more pushpins have the same name, so the FindNearby() method sometimes doesn't start the search at the correct PushPin, so the SearchResult is sometimes just wrong for me. The second problem is that my App will be used by quite a number of "dumb-users", and letting them select the pushpin directly and use the context menu search will give more accurate results than giving them the oportunity to miss-type the company name in my form, which can cause trouble with the search.
If you had an idea on how to access the context menu SearchResult it would be great if you could share it with me.
Thx in advance