View Full Version : Display Pushpin Location on Map from Text Input

03-03-2009, 10:12 AM
I'm trying to display a pushpin when its location is entered into a text box.

MapPoint.Map map = axMappointControlAirportLocation.ActiveMap;
object index = 1;
MapPoint.Pushpin currentpushpin = null;
MapPoint.FindResults findresults = map.FindResults(id);
currentpushpin = findresults.get_Item(ref index) as MapPoint.Pushpin;
if (currentpushpin != null)
currentpushpin.GoTo();The above works but only if the pushpin is the only exact match in MapPoint. The pushpins are stored as a pushpin dataset inside of MapPoint. How can I only search for results from this dataset, i.e. when I search for KAAS I only get my pushpin and not a place in Denmark as the #1 result.

Mattys Consulting
03-14-2009, 11:07 PM
Please see MapPoint Help under Method called ObjectsFromPoint.
Search this site also.

Mike Mattys

03-15-2009, 12:37 PM
FindResults has a property that indicates the quality of the returned results (first good, all good, ambiguous, etc).

A typical application would check this. If multiple results are returned then the application would present the list to the user, to select from.