当前位置: 首页>>代码示例>>C#>>正文


C# Document.GetMapAsync方法代码示例

本文整理汇总了C#中Document.GetMapAsync方法的典型用法代码示例。如果您正苦于以下问题:C# Document.GetMapAsync方法的具体用法?C# Document.GetMapAsync怎么用?C# Document.GetMapAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Document的用法示例。


在下文中一共展示了Document.GetMapAsync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadMapButton_Click

        private void LoadMapButton_Click(object sender, RoutedEventArgs e)
        {
            WebClient webClient = new WebClient();
            string uri = string.Format("http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial?supressStatus=true&key={0}", BingKeyTextBox.Text);

            webClient.OpenReadCompleted += (s, a) =>
            {
                if (a.Error == null)
                {
                    DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(BingAuthentication));
                    BingAuthentication bingAuthentication = serializer.ReadObject(a.Result) as BingAuthentication;
                    a.Result.Close();

                    if (bingAuthentication.authenticationResultCode == "ValidCredentials")
                    {
                        Document webMap = new Document();
                        webMap.BingToken = BingKeyTextBox.Text;
                        webMap.GetMapCompleted += webMap_GetMapCompleted;

                        webMap.GetMapAsync("75e222ec54b244a5b73aeef40ce76adc");

                        BingKeyGrid.Visibility = System.Windows.Visibility.Collapsed;
                        InvalidBingKeyTextBlock.Visibility = System.Windows.Visibility.Collapsed;
                    }
                    else InvalidBingKeyTextBlock.Visibility = System.Windows.Visibility.Visible;
                }
                else InvalidBingKeyTextBlock.Visibility = System.Windows.Visibility.Visible;
            };

            webClient.OpenReadAsync(new System.Uri(uri));
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:31,代码来源:LoadWebMapWithBing.xaml.cs

示例2: LoadMapButton_Click

        private void LoadMapButton_Click(object sender, RoutedEventArgs e)
        {
            WebClient webClient = new WebClient();
            string uri = string.Format("http://dev.virtualearth.net/REST/v1/Imagery/Metadata/Aerial?supressStatus=true&key={0}", BingKeyTextBox.Text);

            webClient.OpenReadCompleted += (s, a) =>
            {
                if (a.Error == null)
                {
                    JsonValue jsonResponse = JsonObject.Load(a.Result);
                    string authenticationResult = jsonResponse["authenticationResultCode"];
                    a.Result.Close();

                    BingKeyGrid.Visibility = System.Windows.Visibility.Collapsed;
                    InvalidBingKeyTextBlock.Visibility = System.Windows.Visibility.Collapsed;

                    if (authenticationResult == "ValidCredentials")
                    {
                        Document webMap = new Document();
                        webMap.BingToken = BingKeyTextBox.Text;
                        webMap.GetMapCompleted += (s1, e1) =>
                        {
                            if (e1.Error == null)
                                LayoutRoot.Children.Add(e1.Map);
                        };

                        webMap.GetMapAsync("75e222ec54b244a5b73aeef40ce76adc");
                    }
                    else InvalidBingKeyTextBlock.Visibility = System.Windows.Visibility.Visible;
                }
                else InvalidBingKeyTextBlock.Visibility = System.Windows.Visibility.Visible;
            };

            webClient.OpenReadAsync(new System.Uri(uri));
        }
开发者ID:konglingjie,项目名称:arcgis-samples-silverlight,代码行数:35,代码来源:LoadWebMapWithBing.xaml.cs

示例3: LoadWebMapButton_Click

        private void LoadWebMapButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(WebMapTextBox.Text))
            {
                Document webMap = new Document();
                webMap.GetMapCompleted += (s, a) =>
                    {
                        if (a.Error != null)
                            MessageBox.Show(string.Format("Unable to load webmap. {0}", a.Error.Message));
                        else
                        {
                            MyMap.Extent = a.Map.Extent;

                            LayerCollection layerCollection = new LayerCollection();
                            foreach (Layer layer in a.Map.Layers)
                                layerCollection.Add(layer);

                            a.Map.Layers.Clear();
                            MyMap.Layers = layerCollection;
                            WebMapPropertiesTextBox.DataContext = a.ItemInfo;
                        }
                    };

                webMap.GetMapAsync(WebMapTextBox.Text);
            }
        }
开发者ID:konglingjie,项目名称:arcgis-samples-silverlight,代码行数:26,代码来源:LoadWebMapDynamically.xaml.cs

示例4: WebMapFeatureServicePopups

        public WebMapFeatureServicePopups()
        {
            InitializeComponent();
            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;

            webMap.GetMapAsync("921e9016d2a5423da8bd08eb306e4e0e");
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:8,代码来源:WebMapFeatureServicePopups.xaml.cs

示例5: WebMapTiledServicePopups

        public WebMapTiledServicePopups()
        {
            InitializeComponent();
            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;

            webMap.GetMapAsync("0e8aa0cc8dcb47d3b9a46e3c6c7c0f8f");
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:8,代码来源:WebMapTiledServicePopups.xaml.cs

示例6: WebMapDynamicServicePopups

        public WebMapDynamicServicePopups()
        {
            InitializeComponent();
            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;

            webMap.GetMapAsync("fd7fb514579f4422ab2698f47a7d4a46");
        }
开发者ID:konglingjie,项目名称:arcgis-samples-silverlight,代码行数:8,代码来源:WebMapDynamicServicePopups.xaml.cs

示例7: WebMapMobileContentServer

        public WebMapMobileContentServer()
        {
            InitializeComponent();
            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;
            webMap.ServerBaseUrl = "http://arcgismobile.esri.com/arcgis/mobile/content";

            webMap.GetMapAsync("00ab0becb052428485a8d25e62afb86d");
        }
开发者ID:konglingjie,项目名称:arcgis-samples-silverlight,代码行数:9,代码来源:WebMapMobileContentServer.xaml.cs

示例8: WebMapCSV

        public WebMapCSV()
        {
            InitializeComponent();
                        
            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;

            webMap.GetMapAsync("e64c82296b5a48acb0a7f18e3f556607");
        }
开发者ID:konglingjie,项目名称:arcgis-samples-silverlight,代码行数:9,代码来源:WebMapCSV.xaml.cs

示例9: WebMapKML

        public WebMapKML()
        {
            InitializeComponent();

            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;
            webMap.ProxyUrl = "http://servicesbeta3.esri.com/SilverlightDemos/ProxyPage/proxy.ashx";
            webMap.GetMapAsync("d2cb7cac8b1947c7b57ed8edd6b045bb");
        }
开发者ID:ealvarezp,项目名称:arcgis-samples-silverlight,代码行数:9,代码来源:WebMapKML.xaml.cs

示例10: WebMapNotesPopups

        public WebMapNotesPopups()
        {
            InitializeComponent();

            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;

            webMap.GetMapAsync("2ccf901c5b414e5c98a346edb75e3c13");
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:9,代码来源:WebMapNotesPopups.xaml.cs

示例11: WebMapWMS

        public WebMapWMS()
        {
            InitializeComponent();

            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;
            webMap.ProxyUrl = "http://serverapps102.esri.com/resourceproxy/net/proxy.ashx";
            webMap.GetMapAsync("b3e11e1d7aac4d6a98fde6b864d3a2b7");
        }
开发者ID:yy475950108,项目名称:arcgis-samples-silverlight,代码行数:9,代码来源:WebMapWMS.xaml.cs

示例12: WebMapWMS

        public WebMapWMS()
        {
            InitializeComponent();

            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;

            webMap.GetMapAsync("b3e11e1d7aac4d6a98fde6b864d3a2b7");
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:9,代码来源:WebMapWMS.xaml.cs

示例13: WebMapCharts

        public WebMapCharts()
        {
            InitializeComponent();

            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;

            webMap.GetMapAsync("3fafddcb23ee41cf9c597054f0da6bd6");
        }
开发者ID:konglingjie,项目名称:arcgis-samples-silverlight,代码行数:9,代码来源:WebMapCharts.xaml.cs

示例14: LoadWebMap

        public LoadWebMap()
        {
            InitializeComponent();

            Document webMap = new Document();
            webMap.GetMapCompleted += webMap_GetMapCompleted;

            webMap.GetMapAsync("00e5e70929e14055ab686df16c842ec1");
        }
开发者ID:Esri,项目名称:arcgis-samples-winphone,代码行数:9,代码来源:LoadWebMap.xaml.cs

示例15: LoadWebMapWithProxy

        public LoadWebMapWithProxy()
        {
            InitializeComponent();

            Document webMap = new Document();
            webMap.ProxyUrl = "http://serverapps102.esri.com/resourceproxy/net/proxy.ashx";
            webMap.GetMapCompleted += webMap_GetMapCompleted;

            webMap.GetMapAsync("07cbed6b51474885b420cd5ed4c3e082");
        }
开发者ID:yy475950108,项目名称:arcgis-samples-silverlight,代码行数:10,代码来源:LoadWebMapWithProxy.xaml.cs


注:本文中的Document.GetMapAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。