/// <summary> /// Methods for looking up points of interest based on a location. Points of interest could /// be things like gas, food and lodging. Standard Industry Codes (SIC) are used to identify the type /// of point of interest you are interested in. Some example sic codes are SICInd554 for Gas, SIC5800 for /// Food and SICInd701 for lodging. /// /// You must specify the datasource like NavTech.NA /// /// </summary> /// <param name="location">result from the FindLocation method</param> /// <param name="POI">Entity code - like the SIC example above</param> /// <param name="dataSource"></param> /// <param name="searchRadius">float allowing of specify the search radius</param> /// <returns>FindResults</returns> public FindResults FindNearByPlaces(Location location, string POI,string dataSource, double searchRadius) { FindResults foundResults = null; try { if (location == null) { throw new System.ArgumentNullException("Location cannot be null"); } if (POI == null) { throw new System.ArgumentNullException("POI cannot be null"); } if (dataSource == null) { throw new System.ArgumentNullException("dataSource cannot be null"); } string POIDatasourceName = dataSource; //string POIEntityTypeName = PointsOfInterest.GetInstance().GetPointOfInterestSICCODE(POI); FindNearbySpecification findNearbySpec = new FindNearbySpecification(); findNearbySpec.DataSourceName = POIDatasourceName; findNearbySpec.Distance = searchRadius; // (myViews(0).Width / 2) * 1.2 findNearbySpec.LatLong = location.LatLong; findNearbySpec.Filter = new FindFilter(); findNearbySpec.Filter.EntityTypeName = POI; findNearbySpec.Options = new FindOptions(); findNearbySpec.Options.Range = new FindRange(); findNearbySpec.Options.Range.Count = 99; foundResults = theMapPointFindService.FindNearby(findNearbySpec); // make sure NumberFound and size of results array are the same foundResults.NumberFound = foundResults.Results.GetLength(0); } catch (ArgumentNullException e) { throw e; // rethrow for app to handle } catch (Exception e) { throw e; // rethrow for app to handle } return foundResults; }
/// <remarks/> public void FindNearbyAsync(FindNearbySpecification specification, object userState) { if ((this.FindNearbyOperationCompleted == null)) { this.FindNearbyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFindNearbyOperationCompleted); } this.InvokeAsync("FindNearby", new object[] { specification}, this.FindNearbyOperationCompleted, userState); }
/// <remarks/> public System.IAsyncResult BeginFindNearby(FindNearbySpecification specification, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("FindNearby", new object[] { specification}, callback, asyncState); }
/// <remarks/> public void FindNearbyAsync(FindNearbySpecification specification) { this.FindNearbyAsync(specification, null); }
public FindResults FindNearby(FindNearbySpecification specification) { object[] results = this.Invoke("FindNearby", new object[] { specification}); return ((FindResults)(results[0])); }