ThinkGeo.com    |     Documentation    |     Premium Support

WmtsAsyncLayer will not open

When I run the following, the layer is still not open and results in an exception when I subsequently try to set the ActiveLayerName.

WmtsAsyncLayer lyr = new WmtsAsyncLayer(uri);
await lyr.OpenAsync();

ActiveLayerName is supposed to be set before opening the layer, otherwise the layer has no idea what specific data to fetch from the server. And updating ActiveLayerName after OpenAsync will not work until reopenning the layer.

If you do have issue when setting layer.ActiveLayerName == “layerName”, please let me know what the exception is.

The exception is that the layer must be opened first. This is the code I was using originally which is why I added the OpenAsync after defining the layer.

WmtsAsyncLayer lyr = new WmtsAsyncLayer(uri);
lyr.ActiveLayerName = lyr.GetServerTileMatrixSetNames().FirstOrDefault();