Hallo,
I try to use some wmts-services, without luck. I use following URLs:
- https://geodienste.sachsen.de/wmts_geosn_webatlas-sn/guest
- https://geodienste.sachsen.de/wmts_geosn_dop-rgb/guest?
When I use the following Code - the app hangs…
private void Window_Loaded(object sender, RoutedEventArgs e)
{
bool logInRequired = false;
bool networkAvailibe = false;
var myProxy = WebProxyHelper.DismaWebProxy(out logInRequired, out networkAvailibe, “http://www.contoso.com”, false);
Map1.MapUnit = GeographyUnit.Meter;
Map1.CurrentExtent = new RectangleShape(4950653.58289573, 23129180.9399217, 81969633.6420015, -22972627.2458641);
WmtsTiledOverlay wmtsTiledOverlay = new WmtsTiledOverlay(new Collection<Uri> { new Uri("https://geodienste.sachsen.de/wmts_geosn_webatlas-sn/guest") });
wmtsTiledOverlay.WmtsServerEncodingType = WmtsSeverEncodingType.Kvp;
wmtsTiledOverlay.Parameters.Add("LAYER", "WebAtlasSN");
wmtsTiledOverlay.Parameters.Add("STYLE", "default");
wmtsTiledOverlay.Parameters.Add("FORMAT", "image/png");
wmtsTiledOverlay.Parameters.Add("TileMatrixSet", "grid_3857");
wmtsTiledOverlay.WebProxy = myProxy;
wmtsTiledOverlay.InitializeConnection();
// contextualWMSLegend=0&crs=EPSG:3857&dpiMode=7&featureCount=10&format=image/png&layers=WMTS&styles=default&tileMatrixSet=grid_3857&url=https://geodienste.sachsen.de/wmts_geosn_webatlas-sn/guest?SERVICE%3DWMTS%26REQUEST%3DGetCapabilities
Map1.Overlays.Add(wmtsTiledOverlay);
Map1.Refresh();
}
When i use the following Code, the App hangs in Drawcore…
public DismaWmtsRasterLayer(Uri uri, System.Net.IWebProxy proxy) : base()
{
this.ServerUris.Add(uri);
this.WmtsSeverEncodingType = WmtsSeverEncodingType.Kvp;
this.UpperScale = double.MaxValue;
this.LowerScale = 0;
this.WebProxy = proxy;
this.Open();
Collection<string> layers = this.GetServerLayerNames();
Collection<string> styles = this.GetServerLayerStyles();
Collection<string> tileMatrixSetNames = this.GetServerTileMatrixSetNames();
if (layers.Count > 0) this.ActiveLayerName = layers[0];
if (styles.Count > 0) this.ActiveStyleName = styles[0];
Collection<string> formats = this.GetLayerOutputFormats(ActiveLayerName);
if (formats.Count > 0) this.OutputFormat = formats[0];
// if (tileMatrixSetNames.Count > 0) this.TileMatrixSetName = tileMatrixSetNames[0];
this.TileMatrixSetName = "grid_3857";
this.Close();
}
protected override void DrawCore(GeoCanvas canvas, Collection<SimpleCandidate> labelsInAllLayers)
{
if (string.IsNullOrWhiteSpace(this.ActiveLayerName)) return;
base.DrawCore(canvas, labelsInAllLayers);
}
Please advise, how to resolve These Errors…
Regards Torsten