コード例 #1
0
        private async void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (TileMatrixSets.Count == 0 && CapabilitiesUri != null)
            {
                try
                {
                    var capabilities = await WmtsCapabilities.ReadCapabilities(CapabilitiesUri, LayerIdentifier);

                    TileMatrixSets.Clear();
                    capabilities.TileMatrixSets.ForEach(s => TileMatrixSets.Add(s.SupportedCrs, s));

                    LayerIdentifier = capabilities.LayerIdentifier;
                    TileSource      = capabilities.TileSource;
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("WmtsTileLayer: {0}: {1}", CapabilitiesUri, ex.Message);
                }
            }
        }
コード例 #2
0
        private async void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (TileMatrixSets.Count == 0 && CapabilitiesUri != null)
            {
                try
                {
                    var capabilities = await WmtsCapabilities.ReadCapabilities(CapabilitiesUri, LayerIdentifier);

                    foreach (var tileMatrixSet in capabilities.TileMatrixSets
                             .Where(s => !TileMatrixSets.ContainsKey(s.SupportedCrs)))
                    {
                        TileMatrixSets.Add(tileMatrixSet.SupportedCrs, tileMatrixSet);
                    }

                    LayerIdentifier = capabilities.LayerIdentifier;
                    TileSource      = capabilities.TileSource;
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("WmtsTileLayer: {0}: {1}", CapabilitiesUri, ex.Message);
                }
            }
        }