I'm attempting to create an overview map of my main map, which is populated with FeatureLayers from a Geopackage. According to the documentation to use a single FeatureLayer on multiple maps the layer should be cloned, and the clone used on the secondary Map. When using Geopackage layers this doesn't appear to work. The cloned layer is returned in a "NotLoaded" LoadStatus.
GeoPackage geoPackage = await GeoPackage.OpenAsync(geoPackagePath);
FeatureTable geoPackageTable = geoPackage.GeoPackageFeatureTables.FirstOrDefault();
if (geoPackageTable == null) { return; }
FeatureLayer newLayer = new FeatureLayer(geoPackageTable);
await newLayer.LoadAsync();
FeatureLayer cloneLayer = (FeatureLayer)newLayer.Clone();
SourceMap.OperationalLayers.Add(newLayer);
CloneMap.OperationalLayers.Add(cloneLayer);
Thus null values are returned for many of the FeatureLayer properties, such as the Renderer or FullExtent. This also means that the Layer itself is not visible on the map.
To load the layer we would call LoadAsync(), but doing so on the cloned layer, creates the following error:
Is this a bug, or is there something I am missing about cloning Geopackage FeatureLayers?