From 5b5164ab507e1677fd3f40aaccb75c48cbbf4d18 Mon Sep 17 00:00:00 2001 From: Katy Dalton Date: Mon, 27 Apr 2015 11:09:51 -0600 Subject: [PATCH] Update OverviewMap sample to use MapView.InteractionOptions instead of IsHitTestVisible. --- .../Samples/Mapping/OverviewMap.xaml | 27 +++++----- .../Samples/Mapping/OverviewMap.xaml.cs | 50 +++++++++---------- .../Samples/Mapping/OverviewMap.xaml | 6 ++- .../Samples/Mapping/OverviewMap.xaml | 37 +++++++------- .../Samples/Mapping/OverviewMap.xaml.cs | 42 ++++++++-------- 5 files changed, 85 insertions(+), 77 deletions(-) diff --git a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/OverviewMap.xaml b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/OverviewMap.xaml index c4e12966c9..8100cbdade 100644 --- a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/OverviewMap.xaml +++ b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/OverviewMap.xaml @@ -1,25 +1,28 @@  - - + 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/runtime/2013"> + + - - - + + + + Margin="30" Padding="20"> + + + + ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" /> @@ -36,5 +39,5 @@ - + diff --git a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/OverviewMap.xaml.cs b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/OverviewMap.xaml.cs index 9ce2fc275f..8d301bf432 100644 --- a/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/OverviewMap.xaml.cs +++ b/src/Desktop/ArcGISRuntimeSDKDotNet_DesktopSamples/Samples/Mapping/OverviewMap.xaml.cs @@ -6,35 +6,35 @@ namespace ArcGISRuntimeSDKDotNet_DesktopSamples.Samples { - /// - /// This sample demonstrates displaying an overview map to indicate the extent of the parent map. - /// - /// Overview Map - /// Mapping - public partial class OverviewMap : UserControl - { - /// Construct Overview Map sample control - public OverviewMap() - { - InitializeComponent(); - MyMapView.ExtentChanged += MyMapView_ExtentChanged; - } + /// + /// This sample demonstrates displaying an overview map to indicate the extent of the parent map. + /// + /// Overview Map + /// Mapping + public partial class OverviewMap : UserControl + { + /// Construct Overview Map sample control + public OverviewMap() + { + InitializeComponent(); + MyMapView.ExtentChanged += MyMapView_ExtentChanged; + } - private async void MyMapView_ExtentChanged(object sender, System.EventArgs e) - { + private async void MyMapView_ExtentChanged(object sender, System.EventArgs e) + { var graphicsOverlay = overviewMap.GraphicsOverlays["overviewOverlay"]; - // Update overview map graphic + // Update overview map graphic Graphic g = graphicsOverlay.Graphics.FirstOrDefault(); - if (g == null) //first time - { - g = new Graphic(); + if (g == null) //first time + { + g = new Graphic(); graphicsOverlay.Graphics.Add(g); - } - g.Geometry = MyMapView.Extent; + } + g.Geometry = MyMapView.Extent; - // Adjust overview map scale - await overviewMap.SetViewAsync(MyMapView.Extent.GetCenter(), MyMapView.Scale * 15); - } - } + // Adjust overview map scale + await overviewMap.SetViewAsync(MyMapView.Extent.GetCenter(), MyMapView.Scale * 15); + } + } } diff --git a/src/Phone/ArcGISRuntimeSDKDotNet_PhoneSamples/Samples/Mapping/OverviewMap.xaml b/src/Phone/ArcGISRuntimeSDKDotNet_PhoneSamples/Samples/Mapping/OverviewMap.xaml index 1f94810519..d26d059ae1 100644 --- a/src/Phone/ArcGISRuntimeSDKDotNet_PhoneSamples/Samples/Mapping/OverviewMap.xaml +++ b/src/Phone/ArcGISRuntimeSDKDotNet_PhoneSamples/Samples/Mapping/OverviewMap.xaml @@ -19,9 +19,11 @@ Margin="20" BorderBrush="White" BorderThickness="2" - Background="LightGray" - IsHitTestVisible="False"> + Background="LightGray" > + + + diff --git a/src/Store/ArcGISRuntimeSDKDotNet_StoreSamples/Samples/Mapping/OverviewMap.xaml b/src/Store/ArcGISRuntimeSDKDotNet_StoreSamples/Samples/Mapping/OverviewMap.xaml index 20d88c6062..b83c16f27a 100644 --- a/src/Store/ArcGISRuntimeSDKDotNet_StoreSamples/Samples/Mapping/OverviewMap.xaml +++ b/src/Store/ArcGISRuntimeSDKDotNet_StoreSamples/Samples/Mapping/OverviewMap.xaml @@ -1,28 +1,31 @@  - - - + + + - - + ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer" /> + + - - - + + + + + + - + @@ -37,6 +40,6 @@ - - + + diff --git a/src/Store/ArcGISRuntimeSDKDotNet_StoreSamples/Samples/Mapping/OverviewMap.xaml.cs b/src/Store/ArcGISRuntimeSDKDotNet_StoreSamples/Samples/Mapping/OverviewMap.xaml.cs index 3e913e300f..a5b64d1252 100644 --- a/src/Store/ArcGISRuntimeSDKDotNet_StoreSamples/Samples/Mapping/OverviewMap.xaml.cs +++ b/src/Store/ArcGISRuntimeSDKDotNet_StoreSamples/Samples/Mapping/OverviewMap.xaml.cs @@ -4,34 +4,34 @@ namespace ArcGISRuntimeSDKDotNet_StoreSamples.Samples { - /// - /// This sample demonstrates displaying an overview map to indicate the extent of the parent map. - /// - /// Overview Map - /// Mapping + /// + /// This sample demonstrates displaying an overview map to indicate the extent of the parent map. + /// + /// Overview Map + /// Mapping public sealed partial class OverviewMap : Page - { - public OverviewMap() - { - this.InitializeComponent(); + { + public OverviewMap() + { + this.InitializeComponent(); MyMapView.ExtentChanged += MyMapView_ExtentChanged; - } + } - private async void MyMapView_ExtentChanged(object sender, System.EventArgs e) - { + private async void MyMapView_ExtentChanged(object sender, System.EventArgs e) + { var graphicsOverlay = overviewMap.GraphicsOverlays["overviewOverlay"]; // Update overview map graphic Graphic g = graphicsOverlay.Graphics.FirstOrDefault(); - if (g == null) //first time - { - g = new Graphic(); + if (g == null) //first time + { + g = new Graphic(); graphicsOverlay.Graphics.Add(g); - } - g.Geometry = MyMapView.Extent; + } + g.Geometry = MyMapView.Extent; - // Adjust overview map scale - await overviewMap.SetViewAsync(MyMapView.Extent.GetCenter(), MyMapView.Scale * 15); - } - } + // Adjust overview map scale + await overviewMap.SetViewAsync(MyMapView.Extent.GetCenter(), MyMapView.Scale * 15); + } + } }