PDA

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



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


MapPoint.Map map = axMappointControlAirportLocation.ActiveMap;
listBoxResults.Items.Clear();
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)
listBoxResults.Items.Add(currentpushpin.Name);
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-15-2009, 12:07 AM
Please see MapPoint Help under Method called ObjectsFromPoint.
Search this site also.

Mike Mattys

Winwaed
03-15-2009, 01: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.


Richard