本文整理汇总了C#中Locator.AddressToLocationsAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Locator.AddressToLocationsAsync方法的具体用法?C# Locator.AddressToLocationsAsync怎么用?C# Locator.AddressToLocationsAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locator
的用法示例。
在下文中一共展示了Locator.AddressToLocationsAsync方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindAddressButton_Click
private void FindAddressButton_Click(object sender, RoutedEventArgs e)
{
Locator locatorTask = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
locatorTask.AddressToLocationsCompleted += LocatorTask_AddressToLocationsCompleted;
locatorTask.Failed += LocatorTask_Failed;
AddressToLocationsParameters addressParams = new AddressToLocationsParameters();
Dictionary<string, string> address = addressParams.Address;
if (!string.IsNullOrEmpty(Address.Text))
address.Add("Address", Address.Text);
if (!string.IsNullOrEmpty(City.Text))
address.Add("City", City.Text);
if (!string.IsNullOrEmpty(State.Text))
address.Add("Region", State.Text);
if (!string.IsNullOrEmpty(Zip.Text))
address.Add("Postal", Zip.Text);
address.Add("forStorage", "true");
address.Add("token","pgPwo32cfo-kLf0ABYjV9RZjxGNfFB4--xSkGLOY4bUx0UhmFMc0-06KJCPtx4uRsIGuO_9xn_cxI2G2w9IoD3hX7Q-LGulIg2VhKUcvklXu7CblMg1--yg5kznhXjSF");
locatorTask.AddressToLocationsAsync(addressParams);
}
示例2: FindAddressButton_Click
private void FindAddressButton_Click(object sender, RoutedEventArgs e)
{
graphicsLayer.ClearGraphics();
AddressBorder.Visibility = Visibility.Collapsed;
ResultsTextBlock.Visibility = Visibility.Collapsed;
Locator locatorTask = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
locatorTask.AddressToLocationsCompleted += LocatorTask_AddressToLocationsCompleted;
locatorTask.Failed += LocatorTask_Failed;
AddressToLocationsParameters addressParams = new AddressToLocationsParameters()
{
OutSpatialReference = MyMap.SpatialReference
};
Dictionary<string, string> address = addressParams.Address;
if (!string.IsNullOrEmpty(Address.Text))
address.Add("Address", Address.Text);
if (!string.IsNullOrEmpty(City.Text))
address.Add("City", City.Text);
if (!string.IsNullOrEmpty(StateAbbrev.Text))
address.Add("Region", StateAbbrev.Text);
if (!string.IsNullOrEmpty(Zip.Text))
address.Add("Postal", Zip.Text);
locatorTask.AddressToLocationsAsync(addressParams);
}
示例3: FindAddressButton_Click
private void FindAddressButton_Click(object sender, RoutedEventArgs e)
{
_locatorTask = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
_locatorTask.AddressToLocationsCompleted += LocatorTask_AddressToLocationsCompleted;
_locatorTask.Failed += LocatorTask_Failed;
AddressToLocationsParameters addressParams = new AddressToLocationsParameters()
{
OutSpatialReference = MyMap.SpatialReference
};
Dictionary<string, string> address = addressParams.Address;
if (!string.IsNullOrEmpty(InputAddress.Text))
address.Add("Address", InputAddress.Text);
if (!string.IsNullOrEmpty(City.Text))
address.Add("City", City.Text);
if (!string.IsNullOrEmpty(State.Text))
address.Add("Region", State.Text);
if (!string.IsNullOrEmpty(Zip.Text))
address.Add("Postal", Zip.Text);
_locatorTask.AddressToLocationsAsync(addressParams);
}
示例4: FindAddressButton_Click
private void FindAddressButton_Click(object sender, RoutedEventArgs e)
{
_locatorTask = new Locator("http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Streets_US/GeocodeServer");
_locatorTask.AddressToLocationsCompleted += LocatorTask_AddressToLocationsCompleted;
_locatorTask.Failed += LocatorTask_Failed;
AddressToLocationsParameters addressParams = new AddressToLocationsParameters()
{
OutSpatialReference = Map.SpatialReference
};
Dictionary<string, string> address = addressParams.Address;
if (!string.IsNullOrEmpty(InputAddress.Text))
address.Add("Street", InputAddress.Text);
if (!string.IsNullOrEmpty(City.Text))
address.Add("City", City.Text);
if (!string.IsNullOrEmpty(State.Text))
address.Add("State", State.Text);
if (!string.IsNullOrEmpty(Zip.Text))
address.Add("ZIP", Zip.Text);
_locatorTask.AddressToLocationsAsync(addressParams);
}
示例5: findAddress
private void findAddress()
{
try
{
if (_mapWidget != null)
{
_mapWidget.Map.MouseClick -= Map_MouseClick;
}
Locator locatorTask = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
locatorTask.AddressToLocationsCompleted += new EventHandler<AddressToLocationsEventArgs>(locatorTask_AddressToLocationsCompleted);
locatorTask.Failed += new EventHandler<TaskFailedEventArgs>(locatorTaskFindAddress_Failed);
AddressToLocationsParameters addressParams = new AddressToLocationsParameters()
{
OutSpatialReference = _mapWidget.Map.SpatialReference
};
Dictionary<string, string> address = addressParams.Address;
address.Add("SingleLine", txtAddress.Text);
txtAddress.Text = "Enter Address";
locatorTask.AddressToLocationsAsync(addressParams);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("error in find address: " + ex.Message);
}
}