DataQueryFindNearestPoints Method (LatLon, String) |
Namespace: Telogis.GeoBase
// // This example will use a GPS unit to find the current location, // and then perform a DataQuery to find the nearest canal to our // current location... // SerialPort myPort = new SerialPort(); // create the GPS's serial port myPort.PortName = "COM1"; // configure the serial port myPort.BaudRate = 9600; IGps myGps = new NMEAGps(myPort); // create GPS unit myGps.PowerUp(); // power up the GPS, ready for use LatLon myLoc = myGps.Position.location; // get the current location PointFeature mCity = DataQuery.FindNearestPoints(myLoc, "major_cities")[0]; // ^^ get the nearest major city to our current location ... // if we have a map, we can center it on the city myMap.Center(mCity.Point);