/// <summary> /// Version of FindLocation that searches using a LatLong object /// </summary> /// <param name="aLatLong">a LatLong</param> /// <returns></returns> public Location FindLocation(LatLong aLatLong) { Location[] location = null; try { if (aLatLong == null) { throw new System.ArgumentNullException("LatLong cannot be null"); } //OK find something FindSpecification fs = new FindSpecification(); fs.DataSourceName = "MapPoint.NA"; LatLong locationLatLong = aLatLong; GetInfoOptions infoOptions = new GetInfoOptions(); location = theMapPointFindService.GetLocationInfo(locationLatLong, MAPPOINT_NA, infoOptions); } catch (ArgumentNullException e) { throw e; // rethrow for app to handle } catch (Exception e) { throw e; // rethrow for app to handle } return location[0]; // zero position should be the best match }
/// <remarks/> public void GetLocationInfoAsync(LatLong location, string dataSourceName, GetInfoOptions options, object userState) { if ((this.GetLocationInfoOperationCompleted == null)) { this.GetLocationInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLocationInfoOperationCompleted); } this.InvokeAsync("GetLocationInfo", new object[] { location, dataSourceName, options}, this.GetLocationInfoOperationCompleted, userState); }
/// <remarks/> public System.IAsyncResult BeginGetLocationInfo(LatLong location, string dataSourceName, GetInfoOptions options, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetLocationInfo", new object[] { location, dataSourceName, options}, callback, asyncState); }
/// <remarks/> public void GetLocationInfoAsync(LatLong location, string dataSourceName, GetInfoOptions options) { this.GetLocationInfoAsync(location, dataSourceName, options, null); }
public Location[] GetLocationInfo(LatLong location, string dataSourceName, GetInfoOptions options) { object[] results = this.Invoke("GetLocationInfo", new object[] { location, dataSourceName, options}); return ((Location[])(results[0])); }