ArcGIS Runtime中点击查询与ArcGIS silverlight API中点击查询十分相似,主要使用下面的两个接口即可轻松实现。
n IdentifyTask
n IdentifyParameters
界面设计XAML代码如下:
<Window x:Class=”ArcGISWPFMapAppRuntime.MainWindow”
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
xmlns:esri=”http://schemas.esri.com/arcgis/client/2009″
Title=”ArcGIS Runtime Demo-点击查询“ Height=”350″ Width=”525″>
<Grid x:Name=”LayoutRoot”>
<esri:Map x:Name=”MyMap”Background=”White” MouseClick=”MyMap_MouseClick” >
<esri:LocalArcGISDynamicMapServiceLayer ID=”lyr1″
Path=”data/USCitiesStates.mpk”/>
<esri:GraphicsLayer ID=”MousePointGraphicsLayer”/>
<esri:GraphicsLayer ID=”ResultsGraphicsLayer”>
<esri:GraphicsLayer.MapTip>
<Border BorderBrush=”DarkGray” CornerRadius=”13″ BorderThickness=”1″ Margin=”0,0,15,15″>
<Border CornerRadius=”1″ Background=”Beige”BorderThickness=”3″ BorderBrush=”DarkCyan”>
<StackPanel Orientation=”Horizontal”HorizontalAlignment=”Center” Margin=”10″>
<TextBlock Text=”{Binding Path=[maptip]}”HorizontalAlignment=”Left” VerticalAlignment=”Center” />
</StackPanel>
</Border>
</Border>
</esri:GraphicsLayer.MapTip>
</esri:GraphicsLayer>
</esri:Map>
<Canvas Height=”64″ HorizontalAlignment=”Left” Margin=”12,12,0,0″ Name=”canvas1″ VerticalAlignment=”Top” Width=”415″ >
<Button Content=”点击查询“ Name=”button1″ Click=”button1_Click” Canvas.Left=”6″ Canvas.Top=”6″ Height=”24″ Width=”66″ />
<Button Content=”漫游地图“ Canvas.Left=”6″ Canvas.Top=”35″ Height=”23″ Name=”button2″ Width=”67″ Click=”button2_Click” />
<Label Content=”选中目标所在图层:“ Canvas.Left=”78″ Canvas.Top=”7″ Height=”31″ Name=”label1″ Width=”314″/>
</Canvas>
<Grid.Resources>
<esri:SimpleMarkerSymbol x:Key=”PointSym” Style=”Circle” Size=”12″ Color=”BlueViolet” />
<esri:SimpleLineSymbol x:Key=”LineSym” Style=”Dash” Width=”5″ Color=”Green”/>
<esri:SimpleFillSymbol x:Key=”PolySym”BorderBrush=”Red” BorderThickness=”2″ Fill=”LightBlue”/>
</Grid.Resources>
</Grid>
</Window>
未完,请见ArcGIS Runtime—点击查询【二】