void webMap_GetMapCompleted(object sender, GetMapCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                // Enable accelerated display
                e.Map.UseAcceleratedDisplay = true;

                // Add Map to the UI
                MainGrid.Children.Add(e.Map);

                // Add bookmarks form Webmap to the UI too.
                if (e.WebMap.Bookmarks.Count > 0)
                {
                    // Add bookmarks
                    var bookmarkControl = new ESRI.ArcGIS.Client.Toolkit.Bookmark();
                    foreach (var item in e.WebMap.Bookmarks)
                    {
                        bookmarkControl.AddBookmark(item.Name, item.Extent);
                    }
                    // Note this could equally be pre defined in Xaml too.
                    bookmarkControl.Map = e.Map;
                    bookmarkControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
                    bookmarkControl.VerticalAlignment = System.Windows.VerticalAlignment.Top;
                    // Add to the UI
                    MainGrid.Children.Add(bookmarkControl);
                }
            }
            else
            {
                MessageBox.Show("Failed to load web map!");
            }
        }
        void webMap_GetMapCompleted(object sender, GetMapCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                // Enable accelerated display
                e.Map.UseAcceleratedDisplay = true;

                // Add Map to the UI
                MainGrid.Children.Add(e.Map);

                // Add bookmarks form Webmap to the UI too.
                if (e.WebMap.Bookmarks.Count > 0)
                {
                    // Add bookmarks
                    var bookmarkControl = new ESRI.ArcGIS.Client.Toolkit.Bookmark();
                    foreach (var item in e.WebMap.Bookmarks)
                    {
                        bookmarkControl.AddBookmark(item.Name, item.Extent);
                    }
                    // Note this could equally be pre defined in Xaml too.
                    bookmarkControl.Map = e.Map;
                    bookmarkControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
                    bookmarkControl.VerticalAlignment   = System.Windows.VerticalAlignment.Top;
                    // Add to the UI
                    MainGrid.Children.Add(bookmarkControl);
                }
            }
            else
            {
                MessageBox.Show("Failed to load web map!");
            }
        }
Example #3
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/hybrid;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.myMap = ((ESRI.ArcGIS.Client.Map)(this.FindName("myMap")));
     this.identifyPanel = ((System.Windows.Controls.StackPanel)(this.FindName("identifyPanel")));
     this.identifyResultsStackPanel = ((System.Windows.Controls.StackPanel)(this.FindName("identifyResultsStackPanel")));
     this.btnHideIdentify = ((System.Windows.Controls.Button)(this.FindName("btnHideIdentify")));
     this.identifyComboBox = ((System.Windows.Controls.ComboBox)(this.FindName("identifyComboBox")));
     this.identifyDetailDataGrid = ((System.Windows.Controls.DataGrid)(this.FindName("identifyDetailDataGrid")));
     this.measureTools = ((System.Windows.Controls.Border)(this.FindName("measureTools")));
     this.btnCloseTools = ((System.Windows.Controls.Button)(this.FindName("btnCloseTools")));
     this.btnPoint = ((System.Windows.Controls.Button)(this.FindName("btnPoint")));
     this.imgPoint = ((System.Windows.Controls.Image)(this.FindName("imgPoint")));
     this.txtBlkPoint = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkPoint")));
     this.btnLine = ((System.Windows.Controls.Button)(this.FindName("btnLine")));
     this.imgLine = ((System.Windows.Controls.Image)(this.FindName("imgLine")));
     this.txtBlkLine = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkLine")));
     this.btnPolygon = ((System.Windows.Controls.Button)(this.FindName("btnPolygon")));
     this.imgPolygon = ((System.Windows.Controls.Image)(this.FindName("imgPolygon")));
     this.txtBlkPolygon = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkPolygon")));
     this.btnClearGraphics = ((System.Windows.Controls.Button)(this.FindName("btnClearGraphics")));
     this.imgClearGraphics = ((System.Windows.Controls.Image)(this.FindName("imgClearGraphics")));
     this.txtBlkClearGraphics = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkClearGraphics")));
     this.txtBlkMeasurement = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkMeasurement")));
     this.scaleline1 = ((ESRI.ArcGIS.Client.Toolkit.ScaleLine)(this.FindName("scaleline1")));
     this.mapProgressBar = ((ESRI.ArcGIS.Client.Toolkit.MapProgressBar)(this.FindName("mapProgressBar")));
     this.bookMarkBar = ((System.Windows.Controls.Border)(this.FindName("bookMarkBar")));
     this.btnHideBookmarks = ((System.Windows.Controls.Button)(this.FindName("btnHideBookmarks")));
     this.txtBlkCloseBookmarks = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkCloseBookmarks")));
     this.bookmark1 = ((ESRI.ArcGIS.Client.Toolkit.Bookmark)(this.FindName("bookmark1")));
     this.sideBar = ((System.Windows.Controls.Border)(this.FindName("sideBar")));
     this.expanderMain = ((System.Windows.Controls.Expander)(this.FindName("expanderMain")));
     this.navTools = ((System.Windows.Controls.StackPanel)(this.FindName("navTools")));
     this.btnZoomIn = ((System.Windows.Controls.Button)(this.FindName("btnZoomIn")));
     this.image1 = ((System.Windows.Controls.Image)(this.FindName("image1")));
     this.txtBlkZoomIn = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkZoomIn")));
     this.btnZoomOut = ((System.Windows.Controls.Button)(this.FindName("btnZoomOut")));
     this.imgZoomOut = ((System.Windows.Controls.Image)(this.FindName("imgZoomOut")));
     this.txtBlkZoomOut = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkZoomOut")));
     this.btnPrevExtent = ((System.Windows.Controls.Button)(this.FindName("btnPrevExtent")));
     this.imgPrevExtent = ((System.Windows.Controls.Image)(this.FindName("imgPrevExtent")));
     this.txtBlkPrevExtent = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkPrevExtent")));
     this.btnNextExtent = ((System.Windows.Controls.Button)(this.FindName("btnNextExtent")));
     this.imgNextExtent = ((System.Windows.Controls.Image)(this.FindName("imgNextExtent")));
     this.txtBlkNextExtent = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkNextExtent")));
     this.btnFullExtent = ((System.Windows.Controls.Button)(this.FindName("btnFullExtent")));
     this.imgFullExtent = ((System.Windows.Controls.Image)(this.FindName("imgFullExtent")));
     this.txtBlkFullExtent = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkFullExtent")));
     this.btnPan = ((System.Windows.Controls.Button)(this.FindName("btnPan")));
     this.imgPan = ((System.Windows.Controls.Image)(this.FindName("imgPan")));
     this.txtBlkPan = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkPan")));
     this.btnIdentify = ((System.Windows.Controls.Button)(this.FindName("btnIdentify")));
     this.imgIdentify = ((System.Windows.Controls.Image)(this.FindName("imgIdentify")));
     this.txtBlkIdentify = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkIdentify")));
     this.btnMeasure = ((System.Windows.Controls.Button)(this.FindName("btnMeasure")));
     this.imgMeasure = ((System.Windows.Controls.Image)(this.FindName("imgMeasure")));
     this.txtBlkMeasure = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkMeasure")));
     this.btnBookmark = ((System.Windows.Controls.Button)(this.FindName("btnBookmark")));
     this.imgBookmark = ((System.Windows.Controls.Image)(this.FindName("imgBookmark")));
     this.txtBlkBookmark = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkBookmark")));
     this.btnHelp = ((System.Windows.Controls.Button)(this.FindName("btnHelp")));
     this.imgHelp = ((System.Windows.Controls.Image)(this.FindName("imgHelp")));
     this.txtBlkHelp = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkHelp")));
     this.btnSearch = ((System.Windows.Controls.Button)(this.FindName("btnSearch")));
     this.imgSearch = ((System.Windows.Controls.Image)(this.FindName("imgSearch")));
     this.txtBlkSearch = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkSearch")));
     this.btnPrint = ((System.Windows.Controls.Button)(this.FindName("btnPrint")));
     this.imgPrint = ((System.Windows.Controls.Image)(this.FindName("imgPrint")));
     this.txtBlkPrint = ((System.Windows.Controls.TextBlock)(this.FindName("txtBlkPrint")));
 }