Page.xaml
上传用户:huazai0421
上传日期:2008-05-30
资源大小:405k
文件大小:52k
源码类别:

SilverLight

开发平台:

C#

  1. <UserControl x:Class="ESRI.ArcGIS.Samples.SilverMapDemo.Page"
  2.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  3.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  4. xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
  5. xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"
  6. xmlns:esriConverters="clr-namespace:ESRI.ArcGIS.Client.ValueConverters;assembly=ESRI.ArcGIS.Client"
  7. xmlns:toolkit="clr-namespace:ESRI.ArcGIS.Client.Toolkit;assembly=ESRI.ArcGIS.Client.Toolkit"
  8. xmlns:symbols="clr-namespace:ESRI.ArcGIS.Client.Symbols;assembly=ESRI.ArcGIS.Client"
  9.     xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
  10. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  11. xmlns:local="clr-namespace:ESRI.ArcGIS.Samples"
  12.     xmlns:pie="clr-namespace:ESRI.ArcGIS.Samples.PieChartSymbology;assembly=ESRI.ArcGIS.Samples.PieChartSymbology"
  13. xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  14. xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  15. Loaded="UserControl_Loaded">
  16. <UserControl.Resources>
  17. <esriConverters:DictionaryConverter x:Name="MyDictionaryConverter" />
  18. <symbols:FillSymbol x:Name="shadowFill">
  19. <symbols:FillSymbol.ControlTemplate>
  20. <ControlTemplate>
  21. <Path x:Name="Element" Fill="#55ffffff" StrokeThickness="3" Stroke="#99ff0000"
  22.   StrokeLineJoin="Round">
  23. <Path.Effect>
  24. <DropShadowEffect Color="Black" Direction="-45" BlurRadius="10" Opacity=".75" />
  25. </Path.Effect>
  26. </Path>
  27. </ControlTemplate>
  28. </symbols:FillSymbol.ControlTemplate>
  29. </symbols:FillSymbol>
  30. <symbols:LineSymbol x:Name="shadowLine">
  31. <symbols:LineSymbol.ControlTemplate>
  32. <ControlTemplate>
  33. <Path x:Name="Element" StrokeThickness="3" Stroke="#99ff0000"
  34.   StrokeLineJoin="Round">
  35. <Path.Effect>
  36. <DropShadowEffect Color="Black" Direction="-45" BlurRadius="10" Opacity=".75" />
  37. </Path.Effect>
  38. </Path>
  39. </ControlTemplate>
  40. </symbols:LineSymbol.ControlTemplate>
  41. </symbols:LineSymbol>
  42. </UserControl.Resources>
  43.     <Grid x:Name="LayoutRoot" Background="#333333">
  44. <Grid.RowDefinitions>
  45. <RowDefinition Height="100" x:Name="TopBarRowDefinition" />
  46. <RowDefinition Height="30" />
  47. <RowDefinition Height="*" />
  48. </Grid.RowDefinitions>
  49. <!--Top bar-->
  50. <Grid Grid.Row="0">
  51. <Grid VerticalAlignment="Bottom" HorizontalAlignment="Left">
  52. <TextBlock Text="{StaticResource Title}" Style="{StaticResource titleTextStyle}" />
  53. <TextBlock Text="{StaticResource Title}" Style="{StaticResource titleTextStyle2}" />
  54. </Grid>
  55. <local:EsriLogo HorizontalAlignment="Right" Margin="0,-5,0,15" 
  56. MouseLeftButtonDown="EsriLogo_MouseLeftButtonDown"
  57. VerticalAlignment="Stretch" />
  58. <Image Source="/Images/SlLogo.png" HorizontalAlignment="Right" Margin="0,0,80,0"  />
  59. </Grid>
  60. <!--Menu bar-->
  61. <Grid Grid.Row="1" x:Name="TopMenuGrid" Background="Black">
  62. <Rectangle x:Name="BackgroundGradient" Opacity=".5" Fill="{StaticResource ReflectionGradient}"/>
  63. <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Horizontal">
  64. <!-- Base layers -->
  65. <local:DropDownMenu>
  66. <local:DropDownMenu.MenuContent>
  67. <Grid>
  68. <Border Style="{StaticResource menuBorder}">
  69. <StackPanel>
  70. <RadioButton Content="Road" Style="{StaticResource radioButton}" 
  71.  Tag="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"
  72.  local:CustomTooltip.ToolTip="This worldwide street map presents highway-level data for the world and street-level data for the United States, Canada, Japan, Southern Africa, and a number of countries in Europe and elsewhere. This comprehensive street map includes highways, major roads, minor roads, railways, water features, administrative boundaries, cities, parks, and landmarks, overlaid on shaded relief imagery for added context. The street map was developed by ESRI using AND road data and UNEP-WCMC parks and protected areas for the world and Tele Atlas Dynamap® and Multinet® street data for North America and Europe. Coverage for street-level data in Europe includes Andorra, Austria, Belgium, Czech Republic, Denmark, France, Germany, Great Britain, Greece, Hungary, Ireland, Italy, Luxembourg, Netherlands, Northern Ireland (Belfast only), Norway, Poland, Portugal, San Marino, Slovakia, Spain, Sweden, and Switzerland. Coverage for street-level data elsewhere in the world includes China (Hong Kong only), Indonesia (Jakarta only), Egypt (Cairo only), Japan, Mexico (Mexico City only), Russia (Moscow, St. Petersburg only), and Turkey (Istanbul, Ankara only)."
  73.  GroupName="BaseLayer" Checked="BaseLayer_Changed" />
  74. <RadioButton Content="Aerial" IsChecked="True" Style="{StaticResource radioButton}" 
  75.  Tag="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"
  76.  local:CustomTooltip.ToolTip="This service presents satellite imagery for the world and high-resolution aerial imagery for the United States. The service includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000) and i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world. The service also includes i-cubed Nationwide Select 1m resolution imagery for the contiguous United States for display at large scales (below 1:70,000). I-cubed Nationwide Select is a seamless, color mosaic of various government imagery sources, including USGS imagery for metropolitan areas and the best available USDA NAIP imagery and enhanced versions of USGS DOQQ imagery for other areas. Lastly, the service also includes imagery assembled by ESRI from various sources through the ArcGIS Online Content Sharing Program. Sources for this imagery include USGS and other organizations."
  77.  Checked="BaseLayer_Changed" GroupName="BaseLayer" />
  78. <RadioButton Content="Shaded Relief" Style="{StaticResource radioButton}" 
  79.  Tag="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_ShadedRelief_World_2D/MapServer"
  80.  local:CustomTooltip.ToolTip="This layer presents a worldwide shaded relief map at approximately 1km or 90m per pixel resolution for the world and 30m resolution for the United States. The shaded relief imagery was developed by ESRI using GTOPO30, SRTM, and NED elevation data from the USGS."
  81.  Checked="BaseLayer_Changed" GroupName="BaseLayer" />
  82. <RadioButton Content="Topographic" Style="{StaticResource radioButton}" 
  83.  Tag="http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"
  84.  Checked="BaseLayer_Changed" GroupName="BaseLayer"
  85.  local:CustomTooltip.ToolTip="This service presents land cover imagery for the world and detailed topographic maps for the United States. The service includes NPS Natural Earth physical map at 1.24km per pixel for the world at small scales, i-cubed eTOPO 1:250,000-scale maps for the contiguous United States at medium scales, and National Geographic TOPO! 1:100,000 and 1:24,000-scale maps (1:250,000 and 1:63,000 in Alaska) for the United States at large scales. The TOPO! maps are seamless, scanned images of USGS paper topographic maps."/>
  86. <RadioButton Content="Physical World" Style="{StaticResource radioButton}" 
  87.  Tag="http://services.arcgisonline.com/ArcGIS/rest/services/NPS_Physical_World_2D/MapServer"
  88.  local:CustomTooltip.ToolTip="This service presents the Natural Earth physical map at 1.24km per pixel for the world and 500m for the world."
  89.  Checked="BaseLayer_Changed" GroupName="BaseLayer" />
  90. </StackPanel>
  91. </Border>
  92. </Grid>
  93. </local:DropDownMenu.MenuContent>
  94. <Button Style="{StaticResource darkButtonStyle}" Margin="5,0,0,0" Cursor="Default" >
  95. <Button.Content>
  96. <StackPanel Orientation="Horizontal">
  97. <TextBlock Text="{StaticResource menu1}" Foreground="White" FontWeight="Bold" />
  98. <Image Source="/Images/Layers-32.png" Height="22" Margin="2,-3,-3,-3" />
  99. </StackPanel>
  100. </Button.Content>
  101. </Button>
  102. </local:DropDownMenu>
  103. <!--Web feeds-->
  104. <local:DropDownMenu>
  105. <local:DropDownMenu.MenuContent>
  106. <Grid>
  107. <Grid.Resources>
  108. <local:MagnitudeConverter x:Name="converter" />
  109. </Grid.Resources>
  110. <Border Style="{StaticResource menuBorder}">
  111. <StackPanel>
  112. <!--Earthquakes-->
  113. <local:LayerCheckBox x:Name="layerFeeds1" 
  114.  ConfiguratorParent="{Binding ElementName=LeftMenu}"
  115.  Map="{Binding ElementName=Map}" Style="{StaticResource checkBox}" Content="Recent Earthquakes (GeoRSS)" >
  116. <local:LayerCheckBox.Layer>
  117. <local:GeoRssLayer ID="Earthquakes" Source="http://earthquake.usgs.gov/eqcenter/catalogs/eqs7day-M2.5.xml" >
  118. <local:GeoRssLayer.Symbol>
  119. <symbols:MarkerSymbol>
  120. <symbols:MarkerSymbol.ControlTemplate>
  121. <ControlTemplate>
  122. <Canvas>
  123. <Rectangle
  124. Canvas.Left="{Binding Attributes, Converter={StaticResource converter}, ConverterParameter=-3, Mode=OneWay}"
  125. Canvas.Top="{Binding Attributes, Converter={StaticResource converter}, ConverterParameter=-3, Mode=OneWay}"
  126. Width="{Binding Attributes, Converter={StaticResource converter}, ConverterParameter=6, Mode=OneWay}"
  127. Height="{Binding Attributes, Converter={StaticResource converter}, ConverterParameter=6, Mode=OneWay}">
  128. <Rectangle.Fill>
  129. <ImageBrush ImageSource="/Images/earthquake.png" />
  130. </Rectangle.Fill>
  131. </Rectangle>
  132. </Canvas>
  133. </ControlTemplate>
  134. </symbols:MarkerSymbol.ControlTemplate>
  135. </symbols:MarkerSymbol>
  136. </local:GeoRssLayer.Symbol>
  137. <local:GeoRssLayer.MapTip>
  138. <Border Style="{StaticResource maptipBorder}">
  139. <StackPanel Orientation="Vertical" >
  140. <TextBlock Foreground="White" FontWeight="Bold" Text="{Binding Converter={StaticResource MyDictionaryConverter}, ConverterParameter=Title, Mode=OneWay}" />
  141. <TextBlock Foreground="White" Text="{Binding Converter={StaticResource MyDictionaryConverter}, ConverterParameter=Summary, Mode=OneWay}" />
  142. </StackPanel>
  143. </Border>
  144. </local:GeoRssLayer.MapTip>
  145. </local:GeoRssLayer>
  146. </local:LayerCheckBox.Layer>
  147. </local:LayerCheckBox>
  148. <!--Emergencies and disasters-->
  149. <local:LayerCheckBox x:Name="layerFeeds2" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  150.  Map="{Binding ElementName=Map}" 
  151. Style="{StaticResource checkBox}" >
  152. <local:LayerCheckBox.Content>
  153. <TextBlock 
  154. ToolTipService.ToolTip="Near realtime international Emergency and Disaster Information"
  155. Text="Emergencies and Disasters (GeoRSS)" />
  156. </local:LayerCheckBox.Content>
  157. <local:LayerCheckBox.Layer>
  158. <local:GeoRssLayer ID="Disasters" Source="../proxy.ashx?http://www.rsoe.hu/hisz/rss/disrss-eng.php"  >
  159. <local:GeoRssLayer.Symbol>
  160. <symbols:PictureMarkerSymbol Source="/Images/Warning.png"
  161. Width="25" Height="34"
  162. OffsetX="12.5" OffsetY="12.5" />
  163. </local:GeoRssLayer.Symbol>
  164. <local:GeoRssLayer.MapTip>
  165. <Border Style="{StaticResource maptipBorder}">
  166. <StackPanel Orientation="Vertical" >
  167. <TextBlock Foreground="White" FontWeight="Bold" Text="{Binding Converter={StaticResource MyDictionaryConverter}, ConverterParameter=Title, Mode=OneWay}" />
  168. <TextBlock Foreground="White" TextWrapping="Wrap" MaxWidth="300" Text="{Binding Converter={StaticResource MyDictionaryConverter}, ConverterParameter=Summary, Mode=OneWay}" />
  169. </StackPanel>
  170. </Border>
  171. </local:GeoRssLayer.MapTip>
  172. </local:GeoRssLayer>
  173. </local:LayerCheckBox.Layer>
  174. </local:LayerCheckBox>
  175. <local:LayerCheckBox x:Name="layerFeeds3" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  176.  Map="{Binding ElementName=Map}" Style="{StaticResource checkBox}" Content="Terra Service (WMS)" >
  177. <local:LayerCheckBox.Layer>
  178. <local:WMSMapServiceLayer ID="Terra Service" 
  179.  Url="http://terraservice.net/ogcmap.ashx"
  180.  ProxyUrl="~../ProxyHandler.ashx"
  181.  SkipGetCapabilities="True"
  182.  Version="1.1.1"
  183.  Layers="DRG" />
  184. </local:LayerCheckBox.Layer>
  185. </local:LayerCheckBox>
  186. </StackPanel>
  187. </Border>
  188. </Grid>
  189. </local:DropDownMenu.MenuContent>
  190. <Button Style="{StaticResource darkButtonStyle}" Margin="5,0,0,0" Cursor="Default" >
  191. <Button.Content>
  192. <StackPanel Orientation="Horizontal">
  193. <TextBlock Text="{StaticResource menu2}" Foreground="White" FontWeight="Bold" />
  194. <Image Source="/Images/rss_small.png" Height="16" Margin="5,0,0,0" />
  195. </StackPanel>
  196. </Button.Content>
  197. </Button>
  198. </local:DropDownMenu>
  199. <!-- Demographics -->
  200. <local:DropDownMenu>
  201. <local:DropDownMenu.MenuContent>
  202. <Grid >
  203. <Border Style="{StaticResource menuBorder}">
  204. <StackPanel>
  205. <!--Ethnicity-->
  206. <local:LayerCheckBox x:Name="layerDemo2" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  207.  Map="{Binding ElementName=Map}" Style="{StaticResource checkBox}" Content="Ethnicity by state" >
  208. <local:LayerCheckBox.Layer>
  209. <esri:FeatureLayer ID="Ethnicity"
  210. Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"
  211. Opacity=".5">
  212. <esri:FeatureLayer.FeatureSymbol>
  213. <symbols:FillSymbol Fill="Transparent" BorderBrush="Black" BorderThickness="1" />
  214. </esri:FeatureLayer.FeatureSymbol>
  215. <esri:FeatureLayer.OutFields>
  216. <sys:String>STATE_NAME</sys:String>
  217. <sys:String>WHITE</sys:String>
  218. <sys:String>BLACK</sys:String>
  219. <sys:String>AMERI_ES</sys:String>
  220. <sys:String>ASIAN</sys:String>
  221. <sys:String>HAWN_PI</sys:String>
  222. <sys:String>HISPANIC</sys:String>
  223. <sys:String>OTHER</sys:String>
  224. <sys:String>MULT_RACE</sys:String>
  225. </esri:FeatureLayer.OutFields>
  226. <esri:FeatureLayer.MapTip>
  227. <Border Style="{StaticResource maptipBorder}" Background="#ee333333">
  228. <pie:PieChartMapTip Name="pieChart" Margin="0" Background="White"
  229.                                                                ChartTitle="{Binding Converter={StaticResource MyDictionaryConverter}, 
  230.                                                                                     ConverterParameter=STATE_NAME, Mode=OneWay}" 
  231.                                                                LegendTitle="Legend" >
  232. <pie:PieChartMapTip.PieElements>
  233. <pie:PieElement FieldName="WHITE" DisplayName="White" />
  234. <pie:PieElement FieldName="BLACK" DisplayName="Black" />
  235. <pie:PieElement FieldName="AMERI_ES" DisplayName="American Indian" />
  236. <pie:PieElement FieldName="ASIAN" DisplayName="Asian" />
  237. <pie:PieElement FieldName="HAWN_PI" DisplayName="Asian" />
  238. <pie:PieElement FieldName="HISPANIC" DisplayName="Hispanic" />
  239. <pie:PieElement FieldName="OTHER" DisplayName="Other" />
  240. <pie:PieElement FieldName="MULT_RACE" DisplayName="Multiple Races" />
  241. </pie:PieChartMapTip.PieElements>
  242. <pie:PieChartMapTip.StylePalette>
  243. <visualizationToolkit:StylePalette>
  244. <Style TargetType="Control">
  245. <Setter Property="Background" Value="DarkRed" />
  246. </Style>
  247. <Style TargetType="Control">
  248. <Setter Property="Background" Value="DarkMagenta" />
  249. </Style>
  250. <Style TargetType="Control">
  251. <Setter Property="Background" Value="DarkOliveGreen" />
  252. </Style>
  253. <Style TargetType="Control">
  254. <Setter Property="Background" Value="DarkBlue"/>
  255. </Style>
  256. <Style TargetType="Control">
  257. <Setter Property="Background" Value="DarkSlateBlue" />
  258. </Style>
  259. <Style TargetType="Control">
  260. <Setter Property="Background" Value="DarkCyan"/>
  261. </Style>
  262. <Style TargetType="Control">
  263. <Setter Property="Background" Value="DarkOrange"/>
  264. </Style>
  265. <Style TargetType="Control">
  266. <Setter Property="Background" Value="DeepSkyBlue"/>
  267. </Style>
  268. </visualizationToolkit:StylePalette>
  269. </pie:PieChartMapTip.StylePalette>
  270. </pie:PieChartMapTip>
  271. </Border>
  272. </esri:FeatureLayer.MapTip>
  273. </esri:FeatureLayer>
  274. </local:LayerCheckBox.Layer>
  275. </local:LayerCheckBox>
  276. <!--US Population 2007-->
  277. <local:LayerCheckBox x:Name="layerDemo3" Map="{Binding ElementName=Map}" 
  278. ConfiguratorParent="{Binding ElementName=LeftMenu}"
  279. Checked="layerChecked" Unchecked="layerUnchecked"
  280. Style="{StaticResource checkBox}" Content="Thematic Rendering" >
  281. <local:LayerCheckBox.Layer>
  282. <esri:GraphicsLayer ID="Thematic Rendering" Opacity=".5">
  283. <esri:GraphicsLayer.MapTip>
  284. <Border Style="{StaticResource maptipBorder}">
  285. <StackPanel Orientation="Vertical">
  286. <StackPanel Orientation="Horizontal" Margin="0,0,0,6">
  287. <TextBlock Text="State: " FontWeight="Bold" Foreground="#FFFFFFFF" />
  288. <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, 
  289. ConverterParameter=STATE_NAME, Mode=OneWay}" Foreground="White" />
  290. </StackPanel>
  291. <StackPanel Orientation="Horizontal">
  292. <TextBlock Text="Population: " FontWeight="Bold" Foreground="#FFFFFFFF" />
  293. <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, 
  294. ConverterParameter=POP2007, Mode=OneWay}" Foreground="White" />
  295. </StackPanel>
  296. </StackPanel>
  297. </Border>
  298. </esri:GraphicsLayer.MapTip>
  299. </esri:GraphicsLayer>
  300. </local:LayerCheckBox.Layer>
  301. <local:LayerCheckBox.Configurator>
  302. <local:ConfiguratorContainer >
  303. <local:ThematicLayerControl Layer="{Binding Layer, ElementName=layerDemo3}" x:Name="thematicLayerControl" />
  304. </local:ConfiguratorContainer>
  305. </local:LayerCheckBox.Configurator>
  306. </local:LayerCheckBox>
  307. <!--Illinois Households-->
  308. <local:LayerCheckBox x:Name="layerDemo4" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  309.  Map="{Binding ElementName=Map}" Style="{StaticResource checkBox}" Content="Households Illinois" >
  310. <local:LayerCheckBox.Layer>
  311. <esri:FeatureLayer ID="Illinois Households" Opacity="0.5"
  312.                     Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3"
  313.                     Where="STATE_NAME='Illinois'">
  314. <esri:FeatureLayer.OutFields>
  315. <sys:String>NAME</sys:String>
  316. <sys:String>HOUSEHOLDS</sys:String>
  317. </esri:FeatureLayer.OutFields>
  318. <esri:FeatureLayer.Renderer>
  319. <esri:ClassBreaksRenderer Attribute="HOUSEHOLDS">
  320. <esri:ClassBreaksRenderer.Classes>
  321. <esri:ClassBreakInfo MinimumValue="0" MaximumValue="10000">
  322. <esri:ClassBreakInfo.Symbol>
  323. <symbols:SimpleFillSymbol Fill="#FFDCDC" BorderBrush="Transparent" BorderThickness="2" />
  324. </esri:ClassBreakInfo.Symbol>
  325. </esri:ClassBreakInfo>
  326. <esri:ClassBreakInfo MinimumValue="10000" MaximumValue="25000">
  327. <esri:ClassBreakInfo.Symbol>
  328. <symbols:SimpleFillSymbol Fill="#FFB4B4" BorderBrush="Transparent" BorderThickness="2" />
  329. </esri:ClassBreakInfo.Symbol>
  330. </esri:ClassBreakInfo>
  331. <esri:ClassBreakInfo MinimumValue="25000" MaximumValue="50000">
  332. <esri:ClassBreakInfo.Symbol>
  333. <symbols:SimpleFillSymbol Fill="#FF8282" BorderBrush="Transparent" BorderThickness="2" />
  334. </esri:ClassBreakInfo.Symbol>
  335. </esri:ClassBreakInfo>
  336. <esri:ClassBreakInfo MinimumValue="50000" MaximumValue="75000">
  337. <esri:ClassBreakInfo.Symbol>
  338. <symbols:SimpleFillSymbol Fill="#FF6464" BorderBrush="Transparent" BorderThickness="2" />
  339. </esri:ClassBreakInfo.Symbol>
  340. </esri:ClassBreakInfo>
  341. <esri:ClassBreakInfo MinimumValue="75000" MaximumValue="100000">
  342. <esri:ClassBreakInfo.Symbol>
  343. <symbols:SimpleFillSymbol Fill="#FF2424" BorderBrush="Transparent" BorderThickness="2" />
  344. </esri:ClassBreakInfo.Symbol>
  345. </esri:ClassBreakInfo>
  346. <esri:ClassBreakInfo MinimumValue="100000" MaximumValue="500000">
  347. <esri:ClassBreakInfo.Symbol>
  348. <symbols:SimpleFillSymbol Fill="#AA0000" BorderBrush="Transparent" BorderThickness="2" />
  349. </esri:ClassBreakInfo.Symbol>
  350. </esri:ClassBreakInfo>
  351. <esri:ClassBreakInfo MinimumValue="500000" MaximumValue="1000000">
  352. <esri:ClassBreakInfo.Symbol>
  353. <symbols:SimpleFillSymbol Fill="#800000" BorderBrush="Transparent" BorderThickness="2" />
  354. </esri:ClassBreakInfo.Symbol>
  355. </esri:ClassBreakInfo>
  356. <esri:ClassBreakInfo MinimumValue="1000000" MaximumValue="10000000">
  357. <esri:ClassBreakInfo.Symbol>
  358. <symbols:SimpleFillSymbol Fill="#400000" BorderBrush="Transparent" BorderThickness="2" />
  359. </esri:ClassBreakInfo.Symbol>
  360. </esri:ClassBreakInfo>
  361. </esri:ClassBreaksRenderer.Classes>
  362. </esri:ClassBreaksRenderer>
  363. </esri:FeatureLayer.Renderer>
  364. <esri:FeatureLayer.MapTip>
  365. <Border Style="{StaticResource menuBorder}">
  366. <StackPanel Orientation="Vertical">
  367. <StackPanel Orientation="Horizontal" Margin="0,0,0,6">
  368. <TextBlock Text="County: " FontWeight="Bold" Foreground="#FFFFFFFF" />
  369. <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, 
  370. ConverterParameter=NAME, Mode=OneWay}" Foreground="White" />
  371. </StackPanel>
  372. <StackPanel Orientation="Horizontal">
  373. <TextBlock Text="Households: " FontWeight="Bold" Foreground="#FFFFFFFF" />
  374. <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, 
  375. ConverterParameter=HOUSEHOLDS, Mode=OneWay}" Foreground="White" />
  376. </StackPanel>
  377. </StackPanel>
  378. </Border>
  379. </esri:FeatureLayer.MapTip>
  380. </esri:FeatureLayer>
  381. </local:LayerCheckBox.Layer>
  382. </local:LayerCheckBox>
  383. <!--Pie chart marker symbol-->
  384. <local:LayerCheckBox x:Name="layerDemo6" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  385.  Map="{Binding ElementName=Map}" Style="{StaticResource checkBox}" Content="Pie chart marker" >
  386. <local:LayerCheckBox.Resources>
  387. <pie:PieMarkerSymbol x:Name="pieChartMarkerSymbol">
  388. <pie:PieMarkerSymbol.Fields>
  389. <pie:Field FieldName="WHITE" DisplayName="White" />
  390. <pie:Field FieldName="BLACK" DisplayName="Black" />
  391. <pie:Field FieldName="AMERI_ES" DisplayName="American Indian" />
  392. <pie:Field FieldName="ASIAN" DisplayName="Asian" />
  393. <pie:Field FieldName="HAWN_PI" DisplayName="Hawaiian/Pacific Islanders" />
  394. <pie:Field FieldName="HISPANIC" DisplayName="Hispanic" />
  395. <pie:Field FieldName="OTHER" DisplayName="Other" />
  396. <pie:Field FieldName="MULT_RACE" DisplayName="Multiple Races" />
  397. </pie:PieMarkerSymbol.Fields>
  398. </pie:PieMarkerSymbol>
  399. </local:LayerCheckBox.Resources>
  400. <local:LayerCheckBox.Layer>
  401. <esri:GraphicsLayer ID="Pie Marker Symbol" MouseEnter="pieCharts_MouseEnter" MouseLeave="pieCharts_MouseLeave" />
  402. </local:LayerCheckBox.Layer>
  403. </local:LayerCheckBox>
  404. <!--SuperTuesday -->
  405. <local:LayerCheckBox x:Name="layerDemo5" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  406.  Map="{Binding ElementName=Map}" Style="{StaticResource checkBox}" Content="Super Tuesday - New York" >
  407. <local:LayerCheckBox.Layer>
  408. <esri:FeatureLayer ID="Super Tuesday" Opacity=".5"
  409.                     Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/SuperTuesdaySample/MapServer/0"
  410.                     Where="STATE_NAME='New York'"
  411.                     >
  412. <esri:FeatureLayer.OutFields>
  413. <sys:String>NAME</sys:String>
  414. <sys:String>ClintonP</sys:String>
  415. <sys:String>ObamaP</sys:String>
  416. </esri:FeatureLayer.OutFields>
  417. <esri:FeatureLayer.Renderer>
  418. <esri:ClassBreaksRenderer Attribute="ObamaP">
  419. <esri:ClassBreaksRenderer.Classes>
  420. <esri:ClassBreakInfo MinimumValue="0" MaximumValue="5">
  421. <esri:ClassBreakInfo.Symbol>
  422. <symbols:SimpleFillSymbol Fill="#FFC184" BorderBrush="Transparent" BorderThickness="2" />
  423. </esri:ClassBreakInfo.Symbol>
  424. </esri:ClassBreakInfo>
  425. <esri:ClassBreakInfo MinimumValue="5" MaximumValue="15">
  426. <esri:ClassBreakInfo.Symbol>
  427. <symbols:SimpleFillSymbol Fill="#FFA851" BorderBrush="Transparent" BorderThickness="2" />
  428. </esri:ClassBreakInfo.Symbol>
  429. </esri:ClassBreakInfo>
  430. <esri:ClassBreakInfo MinimumValue="15" MaximumValue="20">
  431. <esri:ClassBreakInfo.Symbol>
  432. <symbols:SimpleFillSymbol Fill="#FF8C1A" BorderBrush="Transparent" BorderThickness="2" />
  433. </esri:ClassBreakInfo.Symbol>
  434. </esri:ClassBreakInfo>
  435. <esri:ClassBreakInfo MinimumValue="20" MaximumValue="25">
  436. <esri:ClassBreakInfo.Symbol>
  437. <symbols:SimpleFillSymbol Fill="#FFF080" BorderBrush="Transparent" BorderThickness="2" />
  438. </esri:ClassBreakInfo.Symbol>
  439. </esri:ClassBreakInfo>
  440. <esri:ClassBreakInfo MinimumValue="25" MaximumValue="30">
  441. <esri:ClassBreakInfo.Symbol>
  442. <symbols:SimpleFillSymbol Fill="#D56A00" BorderBrush="Transparent" BorderThickness="2" />
  443. </esri:ClassBreakInfo.Symbol>
  444. </esri:ClassBreakInfo>
  445. <esri:ClassBreakInfo MinimumValue="30" MaximumValue="35">
  446. <esri:ClassBreakInfo.Symbol>
  447. <symbols:SimpleFillSymbol Fill="#AE5700" BorderBrush="Transparent" BorderThickness="2" />
  448. </esri:ClassBreakInfo.Symbol>
  449. </esri:ClassBreakInfo>
  450. <esri:ClassBreakInfo MinimumValue="35" MaximumValue="40">
  451. <esri:ClassBreakInfo.Symbol>
  452. <symbols:SimpleFillSymbol Fill="#6F3700" BorderBrush="Transparent" BorderThickness="2" />
  453. </esri:ClassBreakInfo.Symbol>
  454. </esri:ClassBreakInfo>
  455. <esri:ClassBreakInfo MinimumValue="40" MaximumValue="100">
  456. <esri:ClassBreakInfo.Symbol>
  457. <symbols:SimpleFillSymbol Fill="#482400" BorderBrush="Transparent" BorderThickness="2" />
  458. </esri:ClassBreakInfo.Symbol>
  459. </esri:ClassBreakInfo>
  460. </esri:ClassBreaksRenderer.Classes>
  461. </esri:ClassBreaksRenderer>
  462. </esri:FeatureLayer.Renderer>
  463. <esri:FeatureLayer.MapTip>
  464. <Border Style="{StaticResource maptipBorder}">
  465. <StackPanel Orientation="Vertical">
  466. <StackPanel Orientation="Horizontal" Margin="0,0,0,6">
  467. <TextBlock Text="County: " FontWeight="Bold" Foreground="#FFFFFFFF" />
  468. <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, 
  469. ConverterParameter=NAME, Mode=OneWay}" Foreground="White" />
  470. </StackPanel>
  471. <StackPanel Orientation="Horizontal">
  472. <TextBlock Text="Clinton: " FontWeight="Bold" Foreground="#FFFFFFFF" />
  473. <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, 
  474. ConverterParameter=ClintonP, Mode=OneWay}" Foreground="White" />
  475. <TextBlock Text="%" Foreground="#FFFFFFFF" />
  476. </StackPanel>
  477. <StackPanel Orientation="Horizontal">
  478. <TextBlock Text="Obama: " FontWeight="Bold" Foreground="#FFFFFFFF" />
  479. <TextBlock Text="{Binding Converter={StaticResource MyDictionaryConverter}, 
  480. ConverterParameter=ObamaP, Mode=OneWay}" Foreground="White" />
  481. <TextBlock Text="%" Foreground="#FFFFFFFF" />
  482. </StackPanel>
  483. </StackPanel>
  484. </Border>
  485. </esri:FeatureLayer.MapTip>
  486. </esri:FeatureLayer>
  487. </local:LayerCheckBox.Layer>
  488. </local:LayerCheckBox>
  489. <!--Earthquake heatmap-->
  490. <local:LayerCheckBox x:Name="layerDemo1" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  491.  Map="{Binding ElementName=Map}" 
  492. Checked="layerChecked" Unchecked="layerUnchecked"
  493. Style="{StaticResource checkBox}" Content="Earthquakes (Heatmap)" >
  494. <local:LayerCheckBox.Layer>
  495. <local:HeatMapLayer ID="Heat map - Earthquakes" 
  496. Opacity=".5" Intensity="30" />
  497. </local:LayerCheckBox.Layer>
  498. <local:LayerCheckBox.Configurator>
  499. <local:ConfiguratorContainer >
  500. <StackPanel>
  501. <TextBlock Text="Intensity" Foreground="White" />
  502. <Slider Value="{Binding Path=Layer.Intensity, ElementName=layerDemo1, Mode=TwoWay}" Minimum="5" Maximum="50" 
  503. Margin="5" x:Name="earthQuakeIntensitySlider"
  504. Background="Transparent"
  505. HorizontalAlignment="Stretch" Height="18" />
  506. </StackPanel>
  507. </local:ConfiguratorContainer>
  508. </local:LayerCheckBox.Configurator>
  509. </local:LayerCheckBox>
  510. </StackPanel>
  511. </Border>
  512. </Grid>
  513. </local:DropDownMenu.MenuContent>
  514. <Button Style="{StaticResource darkButtonStyle}" Margin="5,0,0,0" Cursor="Default" >
  515. <Button.Content>
  516. <StackPanel Orientation="Horizontal">
  517. <TextBlock Text="{StaticResource menu4}" Foreground="White" FontWeight="Bold" />
  518. <Image Source="/Images/Pie-chart-32.png" Height="20" Margin="5,-2,0,-2" />
  519. </StackPanel>
  520. </Button.Content>
  521. </Button>
  522. </local:DropDownMenu>
  523. <!-- Media -->
  524. <MediaElement x:Name="shakeOutMedia"
  525. AutoPlay="False" Width="0" Height="0"
  526. Source="http://serverapps.esri.com/media/scec-shakeout-simulation-rt.wmv"
  527. IsMuted="True" Stretch="Fill" />
  528. <MediaElement x:Name="IkeVideo" Width="0" Height="0"
  529. Source="http://serverapps.esri.com/media/Hurricane_Ike.wmv" 
  530. AutoPlay="False" IsMuted="True" />
  531. <local:DropDownMenu>
  532. <local:DropDownMenu.MenuContent>
  533. <Grid >
  534. <Border Style="{StaticResource menuBorder}">
  535. <StackPanel>
  536. <local:LayerCheckBox x:Name="layerMedia1" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  537.  Map="{Binding ElementName=Map}" 
  538. Checked="layerChecked" Unchecked="layerUnchecked"
  539. Style="{StaticResource checkBox}" Content="ShakeOut 2008" >
  540. <local:LayerCheckBox.Resources>
  541. </local:LayerCheckBox.Resources>
  542. <local:LayerCheckBox.Layer>
  543. <esri:ElementLayer ID="ShakeOut 2008" >
  544. <esri:ElementLayer.Children>
  545. <Rectangle 
  546. esri:ElementLayer.Envelope="-120.309183241879,32.3360853442552,-114.543827787924,35.579097787105">
  547. <Rectangle.Fill>
  548. <VideoBrush  SourceName="shakeOutMedia" x:Name="shakeOutBrush2" />
  549. </Rectangle.Fill>
  550. <Rectangle.RenderTransform>
  551. <RotateTransform Angle="-1.1412502857301" />
  552. </Rectangle.RenderTransform>
  553. </Rectangle>
  554. </esri:ElementLayer.Children>
  555. </esri:ElementLayer>
  556. </local:LayerCheckBox.Layer>
  557. <local:LayerCheckBox.Configurator>
  558. <local:ConfiguratorContainer >
  559. <local:VideoController Media="{Binding ElementName=shakeOutMedia}" x:Name="shakeOutController" />
  560. </local:ConfiguratorContainer>
  561. </local:LayerCheckBox.Configurator>
  562. </local:LayerCheckBox>
  563. <local:LayerCheckBox x:Name="layerMedia2" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  564.  Map="{Binding ElementName=Map}" 
  565. Checked="layerChecked" Unchecked="layerUnchecked"
  566. Style="{StaticResource checkBox}" Content="Hurricane Ike" >
  567. <local:LayerCheckBox.Layer>
  568. <esri:ElementLayer ID="Hurrikane Ike" Opacity=".5" >
  569. <esri:ElementLayer.Children>
  570. <!-- MediaElement source can define relative path from the perspective of the xap file. -->
  571. <Rectangle 
  572. esri:ElementLayer.Envelope="-110.54568606816,20.6202883800494,-60.0794432229144,58.4699705139836">
  573. <Rectangle.Fill>
  574. <VideoBrush SourceName="IkeVideo" />
  575. </Rectangle.Fill>
  576. <Rectangle.RenderTransform>
  577. <RotateTransform Angle="4.32779046937072" />
  578. </Rectangle.RenderTransform>
  579. </Rectangle>
  580. </esri:ElementLayer.Children>
  581. </esri:ElementLayer>
  582. </local:LayerCheckBox.Layer>
  583. <local:LayerCheckBox.Configurator>
  584. <local:ConfiguratorContainer >
  585. <local:VideoController Media="{Binding ElementName=IkeVideo}" x:Name="hurricaneIkeController" />
  586. </local:ConfiguratorContainer>
  587. </local:LayerCheckBox.Configurator>
  588. </local:LayerCheckBox>
  589. </StackPanel>
  590. </Border>
  591. </Grid>
  592. </local:DropDownMenu.MenuContent>
  593. <Button Style="{StaticResource darkButtonStyle}" Margin="5,0,0,0" Cursor="Default" >
  594. <Button.Content>
  595. <StackPanel Orientation="Horizontal">
  596. <TextBlock Text="{StaticResource menu5}" Foreground="White" FontWeight="Bold" />
  597. <Image Source="/Images/Video-32.png" Height="20" Margin="5,-2,0,-4" />
  598. </StackPanel>
  599. </Button.Content>
  600. </Button>
  601. </local:DropDownMenu>
  602. <!-- Weather -->
  603. <local:DropDownMenu>
  604. <local:DropDownMenu.MenuContent>
  605. <Grid Width="200">
  606. <Border Style="{StaticResource menuBorder}">
  607. <StackPanel>
  608. <StackPanel.Resources>
  609. <local:WMSMapServiceLayer x:Name="globeLayer" ID="Globe" 
  610. Url="http://viz.globe.gov/viz-bin/wmt.cgi"
  611. ProxyUrl="~../ProxyHandler.ashx" Layers="SWTMP"
  612. Initialized="globeLayer_Initialized"
  613. SkipGetCapabilities="False"
  614. Version="1.1.1" Opacity="0.7" />
  615. </StackPanel.Resources>
  616. <local:LayerCheckBox x:Name="layerWeather1" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  617.  Map="{Binding ElementName=Map}" Style="{StaticResource checkBox}" Content="Mesonet Radar (WMS)" >
  618. <local:LayerCheckBox.Layer>
  619. <local:WMSMapServiceLayer ID="Mesonet Radar" 
  620. Url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi"
  621. ProxyUrl="~../ProxyHandler.ashx"
  622. SkipGetCapabilities="False"
  623. Layers="nexrad-n0r" Version="1.1.1" Opacity="0.7" />
  624. </local:LayerCheckBox.Layer>
  625. </local:LayerCheckBox>
  626. <local:LayerCheckBox x:Name="layerWeather2" ConfiguratorParent="{Binding ElementName=LeftMenu}"
  627.  Map="{Binding ElementName=Map}" 
  628. Checked="layerChecked" Unchecked="layerUnchecked"
  629. Layer="{StaticResource globeLayer}"
  630. Style="{StaticResource checkBox}" Content="Globe.gov (WMS)" >
  631. <local:LayerCheckBox.Configurator>
  632. <local:ConfiguratorContainer Visibility="Collapsed">
  633. <StackPanel>
  634. <ComboBox x:Name="wmsLayerList"
  635. Style="{StaticResource comboBox}" 
  636. SelectionChanged="wmsLayerList_SelectionChanged"
  637. ItemsSource="{Binding Source={StaticResource globeLayer}, Path=LayerList}">
  638. <ComboBox.ItemTemplate>
  639. <DataTemplate>
  640. <TextBlock Text="{Binding Title}" Foreground="White"
  641. ToolTipService.ToolTip="{Binding Abstract}" />
  642. </DataTemplate>
  643. </ComboBox.ItemTemplate>
  644. </ComboBox>
  645. </StackPanel>
  646. </local:ConfiguratorContainer>
  647. </local:LayerCheckBox.Configurator>
  648. </local:LayerCheckBox>
  649. </StackPanel>
  650. </Border>
  651. </Grid>
  652. </local:DropDownMenu.MenuContent>
  653. <Button Style="{StaticResource darkButtonStyle}" Margin="5,0,0,0" Cursor="Default" >
  654. <Button.Content>
  655. <StackPanel Orientation="Horizontal">
  656. <TextBlock Text="{StaticResource menu3}" Foreground="White" FontWeight="Bold" />
  657. <Image Source="/Images/weather.png" Height="16" Margin="5,0,0,0" />
  658. </StackPanel>
  659. </Button.Content>
  660. </Button>
  661. </local:DropDownMenu>
  662. </StackPanel>
  663. <!--TOp Menu bar - Right side-->
  664. <StackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
  665. <Button Style="{StaticResource darkButtonStyle}">
  666. <Button.Content>
  667. <Image Source="/Images/Tools_32x32.png" Height="16" 
  668.    ToolTipService.ToolTip="Toggle Tools Window"/>
  669. </Button.Content>
  670. <i:Interaction.Triggers>
  671. <i:EventTrigger EventName="Click" >
  672. <local:ToggleWindowVisibilityAction TargetName="toolsWindow" />
  673. </i:EventTrigger>
  674. </i:Interaction.Triggers>
  675. </Button>
  676. <Button Style="{StaticResource darkButtonStyle}" Margin="3,0,0,0" >
  677. <Button.Content>
  678. <Image Source="/Images/Fullscreen-32.png" Height="24" Margin="-4"
  679.    ToolTipService.ToolTip="Toggle Fullscreen"/>
  680. </Button.Content>
  681. <i:Interaction.Triggers>
  682. <i:EventTrigger EventName="Click" >
  683. <local:ToggleFullScreenAction />
  684. </i:EventTrigger>
  685. </i:Interaction.Triggers>
  686. </Button>
  687. <local:LocatorControl Map="{Binding ElementName=Map}" Height="22" x:Name="locator" Margin="5,0,2,0" />
  688. </StackPanel>
  689. </Grid>
  690. <Grid Grid.Row="2">
  691. <Grid.ColumnDefinitions>
  692. <ColumnDefinition Width="0" x:Name="RightColumnDefinition" />
  693. <ColumnDefinition Width="0" x:Name="RightColumnSplitterDefinition" />
  694. <ColumnDefinition Width="*" />
  695. </Grid.ColumnDefinitions>
  696. <ScrollViewer VerticalScrollBarVisibility="Auto">
  697. <StackPanel Grid.Column="0" x:Name="LeftMenu"/>
  698. </ScrollViewer>
  699. <controls:GridSplitter x:Name="grsplSplitter" Grid.Column="1" VerticalAlignment="Stretch"
  700. Background="Black"  Style="{StaticResource GridSplitterStyleBlack}"
  701. HorizontalAlignment="Center" Width="9" />
  702. <!-- Map area -->
  703. <Grid x:Name="MainGrid" Grid.Column="2">
  704. <esri:Map x:Name="Map" Extent="-130,30,-70,50"
  705.   >
  706. <esri:ArcGISTiledMapServiceLayer ID="Base layer" 
  707. Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"/>
  708. <esri:GraphicsLayer ID="Annotations" MouseLeftButtonDown="annotations_MouseLeftButtonDown" >
  709. <esri:GraphicsLayer.Renderer>
  710. <local:SimpleRenderer />
  711. </esri:GraphicsLayer.Renderer>
  712. </esri:GraphicsLayer>
  713. <i:Interaction.Behaviors>
  714. <local:WheelZoom /> <!-- This behavior enables mousewheel in fullscreen and out-of-browser using the new SL3 mousewheel event -->
  715. </i:Interaction.Behaviors>
  716. </esri:Map>
  717. <local:MapProgress Map="{Binding ElementName=Map}"
  718.    HorizontalAlignment="Center"
  719.    VerticalAlignment="Bottom"
  720.    Width="150" Height="12" Margin="2"
  721.    IsHitTestVisible="False" />
  722. <Grid x:Name="InitializeLayer" Visibility="Collapsed" Opacity=".75"
  723.   HorizontalAlignment="Center" VerticalAlignment="Center" Background="#66000000" >
  724. <TextBlock Text="Loading Layer..." Foreground="White" IsHitTestVisible="False" Margin="3"  />
  725. </Grid>
  726. <local:ScaleBar x:Name="scaleBar" Opacity=".5"
  727. Map="{Binding ElementName=Map}" 
  728. MapUnit="DecimalDegrees" Width="200" Fill="White"
  729. Margin="5,0,10,0" IsHitTestVisible="False"
  730. HorizontalAlignment="Left" VerticalAlignment="Bottom" />
  731. <toolkit:Navigation x:Name="nav" 
  732. Margin="10" Map="{Binding ElementName=Map}" 
  733. HorizontalAlignment="Left" VerticalAlignment="Top" 
  734. Style="{StaticResource NavigationStyle}" >
  735. <toolkit:Navigation.Effect>
  736. <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" />
  737. </toolkit:Navigation.Effect>
  738. </toolkit:Navigation>
  739. <Canvas HorizontalAlignment="Left" VerticalAlignment="Top" >
  740. <toolkit:MagnifyingGlass x:Name="mag" Map="{Binding ElementName=Map}" Visibility="Collapsed" Canvas.Left="200" Canvas.Top="200" >
  741. <toolkit:MagnifyingGlass.Layer>
  742. <esri:ArcGISTiledMapServiceLayer ID="Base layer" 
  743. Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"/>
  744. </toolkit:MagnifyingGlass.Layer>
  745. </toolkit:MagnifyingGlass>
  746. </Canvas>
  747. </Grid>
  748. </Grid>
  749. <!-- Windows -->
  750. <!--Toolbar window-->
  751. <local:DraggableWindow IsOpen="False" x:Name="toolsWindow"
  752. Grid.Row="2" Margin="3"
  753. VerticalAlignment="Top"
  754. HorizontalAlignment="Center"
  755. Title="Map Tools">
  756. <StackPanel>
  757. <!--First row-->
  758. <StackPanel Orientation="Horizontal">
  759. <ToggleButton HorizontalAlignment="Right" VerticalAlignment="Center" 
  760.   Height="30" Width="30" Margin="0,0,2,0"
  761.   local:Utilities.ToggleGroup="tools"
  762.   Checked="toggleDraw_Checked"
  763.   Unchecked="toggleDraw_Unchecked"
  764.   x:Name="toggleDrawPoint"
  765.   ToolTipService.ToolTip="Draw point"
  766.   Style="{StaticResource darkToggleButtonStyle}">
  767. <ToggleButton.Content>
  768. <Image Source="/Images/DrawPoint.png" />
  769. </ToggleButton.Content>
  770. </ToggleButton>
  771. <ToggleButton HorizontalAlignment="Right" VerticalAlignment="Center" 
  772.   Height="30" Width="30" Margin="0,0,2,0"
  773.   local:Utilities.ToggleGroup="tools"
  774.   Checked="toggleDraw_Checked"
  775.   Unchecked="toggleDraw_Unchecked"
  776.   x:Name="toggleDrawPolyline"
  777.   ToolTipService.ToolTip="Draw polyline"
  778.   Style="{StaticResource darkToggleButtonStyle}">
  779. <ToggleButton.Content>
  780. <Image Source="/Images/DrawPolyline.png" />
  781. </ToggleButton.Content>
  782. </ToggleButton>
  783. <ToggleButton HorizontalAlignment="Right" VerticalAlignment="Center" 
  784.   Height="30" Width="30" Margin="0,0,2,0"
  785.   local:Utilities.ToggleGroup="tools"
  786.   Checked="toggleDraw_Checked"
  787.   Unchecked="toggleDraw_Unchecked"
  788.   x:Name="toggleDrawPolygon"
  789.   ToolTipService.ToolTip="Draw polygon"
  790.   Style="{StaticResource darkToggleButtonStyle}">
  791. <ToggleButton.Content>
  792. <Image Source="/Images/DrawPolygon.png" />
  793. </ToggleButton.Content>
  794. </ToggleButton>
  795. <ToggleButton HorizontalAlignment="Right" VerticalAlignment="Center" 
  796.   Height="30" Width="30" Margin="0,0,2,0"
  797.   local:Utilities.ToggleGroup="tools"
  798.   Checked="toggleDraw_Checked"
  799.   Unchecked="toggleDraw_Unchecked"
  800.   x:Name="toggleDrawRectangle"
  801.  ToolTipService.ToolTip="Draw rectangle"
  802.    Style="{StaticResource darkToggleButtonStyle}">
  803. <ToggleButton.Content>
  804. <Image Source="/Images/DrawRectangle.png" />
  805. </ToggleButton.Content>
  806. </ToggleButton>
  807. <ToggleButton HorizontalAlignment="Right" VerticalAlignment="Center" 
  808.   Height="30" Width="30" Margin="0,0,2,0"
  809.   local:Utilities.ToggleGroup="tools"
  810.   Checked="toggleDraw_Checked"
  811.   Unchecked="toggleDraw_Unchecked"
  812.   x:Name="toggleDrawFreehand"
  813.  ToolTipService.ToolTip="Draw Freehand"
  814.    Style="{StaticResource darkToggleButtonStyle}">
  815. <ToggleButton.Content>
  816. <Image Source="/Images/DrawFreehand.png" />
  817. </ToggleButton.Content>
  818. </ToggleButton>
  819. <ToggleButton HorizontalAlignment="Right" VerticalAlignment="Center" 
  820.   Height="30" Width="30" Margin="0,0,2,0"
  821.   local:Utilities.ToggleGroup="tools"
  822.   Checked="toggleEditGeometry_Checked"
  823.   Unchecked="toggleEditGeometry_Checked"
  824.   x:Name="toggleEditGeometry"
  825.   ToolTipService.ToolTip="Edit annotation"
  826.   Style="{StaticResource darkToggleButtonStyle}">
  827. <ToggleButton.Content>
  828. <Image Source="/Images/EditGeometry.png" Width="16" Height="16" />
  829. </ToggleButton.Content>
  830. </ToggleButton>
  831. <ToggleButton HorizontalAlignment="Right" VerticalAlignment="Center" 
  832.   Height="30" Width="30" Margin="0,0,2,0"
  833.   local:Utilities.ToggleGroup="tools"
  834.   x:Name="toggleDeleteGraphics"
  835.   ToolTipService.ToolTip="Delete annotation"
  836.   Style="{StaticResource darkToggleButtonStyle}">
  837. <ToggleButton.Content>
  838. <Image Source="/Images/DeleteGraphics.png" />
  839. </ToggleButton.Content>
  840. </ToggleButton>
  841. </StackPanel>
  842. <!--Second row-->
  843. <StackPanel Orientation="Horizontal">
  844. <ToggleButton HorizontalAlignment="Right" VerticalAlignment="Center" 
  845.   Height="30" Width="30" Margin="0,0,2,0"
  846.   Unchecked="GeoMeasureToggleButton_Checked" 
  847.   Checked="GeoMeasureToggleButton_Checked"
  848.   local:Utilities.ToggleGroup="tools"
  849.   ToolTipService.ToolTip="Measure radius"
  850.   Style="{StaticResource darkToggleButtonStyle}">
  851. <ToggleButton.Content>
  852. <Image Source="/Images/radius.png" />
  853. </ToggleButton.Content>
  854. </ToggleButton>
  855. <ToggleButton HorizontalAlignment="Right" VerticalAlignment="Center" 
  856.   Height="30" Width="30" Margin="0,0,2,0"
  857.   local:Utilities.ToggleGroup="tools" x:Name="MeasureDistance"
  858.   ToolTipService.ToolTip="Measure distance" Checked="Measure_Checked" Unchecked="Measure_Unchecked"
  859.   Style="{StaticResource darkToggleButtonStyle}">
  860. <ToggleButton.Content>
  861. <Image Source="/Images/MeasureDistance.png" />
  862. </ToggleButton.Content>
  863. </ToggleButton>
  864. <ToggleButton HorizontalAlignment="Right" VerticalAlignment="Center" 
  865.   Height="30" Width="30" Margin="0,0,2,0"
  866.   local:Utilities.ToggleGroup="tools" x:Name="MeasureArea"
  867.   ToolTipService.ToolTip="Measure area" Checked="Measure_Checked" Unchecked="Measure_Unchecked"
  868.   Style="{StaticResource darkToggleButtonStyle}">
  869. <ToggleButton.Content>
  870. <Image Source="/Images/MeasureArea.png" />
  871. </ToggleButton.Content>
  872. </ToggleButton>
  873. <Button Style="{StaticResource darkButtonStyle}"
  874. Height="30" Width="30" Margin="0,0,2,0"
  875. HorizontalContentAlignment="Left"
  876. Padding="2"
  877. ToolTipService.ToolTip="Toggle Overview Map" >
  878. <Button.Content>
  879. <Image Source="/Images/Maps-blue-32.png" />
  880. </Button.Content>
  881. <i:Interaction.Triggers>
  882. <i:EventTrigger EventName="Click" >
  883. <local:ToggleWindowVisibilityAction TargetName="OverviewWindow" />
  884. </i:EventTrigger>
  885. </i:Interaction.Triggers>
  886. </Button>
  887. <Button Style="{StaticResource darkButtonStyle}"
  888. Height="30" Width="30" Margin="0,0,2,0"
  889. Padding="2"
  890. HorizontalContentAlignment="Left"
  891. ToolTipService.ToolTip="Toggle Layers Window" >
  892. <Button.Content>
  893. <Image Source="/Images/Layers-32.png" />
  894. </Button.Content>
  895. <i:Interaction.Triggers>
  896. <i:EventTrigger EventName="Click" >
  897. <local:ToggleWindowVisibilityAction TargetName="layersWindow" />
  898. </i:EventTrigger>
  899. </i:Interaction.Triggers>
  900. </Button>
  901. <Button Style="{StaticResource darkButtonStyle}"
  902. HorizontalContentAlignment="Left"
  903. Height="30" Width="30" Margin="0,0,2,0"
  904. Padding="3"
  905. ToolTipService.ToolTip="Toggle Bookmarks Window" >
  906. <Button.Content>
  907. <Image Source="/Images/bookmark_add-32.png" />
  908. </Button.Content>
  909. <i:Interaction.Triggers>
  910. <i:EventTrigger EventName="Click" >
  911. <local:ToggleWindowVisibilityAction TargetName="BookmarksWindow" />
  912. </i:EventTrigger>
  913. </i:Interaction.Triggers>
  914. </Button>
  915. <Button Style="{StaticResource darkButtonStyle}"
  916. Height="30" Width="30" Margin="0,0,2,0"
  917. HorizontalContentAlignment="Left"
  918. Padding="3"
  919. ToolTipService.ToolTip="Toggle Magnifying Glass" >
  920. <Button.Content>
  921. <Image Source="/Images/Search-32.png" />
  922. </Button.Content>
  923. <i:Interaction.Triggers>
  924. <i:EventTrigger EventName="Click" >
  925. <local:ToggleVisibilityAction TargetName="mag" />
  926. </i:EventTrigger>
  927. </i:Interaction.Triggers>
  928. </Button>
  929. </StackPanel>
  930. </StackPanel>
  931. </local:DraggableWindow>
  932. <!--Layers window-->
  933. <local:DraggableWindow IsOpen="False" x:Name="layersWindow"
  934. Grid.Row="2"
  935. Margin="20"
  936. VerticalAlignment="Top"
  937. HorizontalAlignment="Right"
  938. Title="Layer controls">
  939. <local:LayerList x:Name="LayerControlList" Map="{Binding ElementName=Map}" />
  940. </local:DraggableWindow>
  941. <!--Overviewmap window-->
  942. <local:DraggableWindow IsOpen="False" x:Name="OverviewWindow"
  943. Grid.Row="2"
  944. Margin="20,100"
  945. VerticalAlignment="Top"
  946. HorizontalAlignment="Right"
  947. Width="300" Height="150"
  948. Padding="0"
  949. HorizontalContentAlignment="Stretch"
  950. VerticalContentAlignment="Stretch"
  951. Title="Overview Map">
  952. <toolkit:OverviewMap x:Name="OverView" Map="{Binding ElementName=Map}" Background="White">
  953. <toolkit:OverviewMap.Layer>
  954. <esri:ArcGISTiledMapServiceLayer 
  955. Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
  956. </toolkit:OverviewMap.Layer>
  957. </toolkit:OverviewMap>
  958. </local:DraggableWindow>
  959. <!--Bookmarks window-->
  960. <local:DraggableWindow IsOpen="False" x:Name="BookmarksWindow" Title="Bookmarks"
  961. Grid.Row="2"
  962. Padding="0" Margin="20,100"
  963. VerticalAlignment="Top" HorizontalAlignment="Right"
  964. HorizontalContentAlignment="Stretch" VerticalContentAlignment="Top">
  965.             <toolkit:Bookmark x:Name="Bookmark" Map="{Binding ElementName=Map}"
  966.   Style="{StaticResource BookmarkStyle}" Width="200" />
  967.         </local:DraggableWindow>
  968.     </Grid>
  969. </UserControl>