HI,
I am using ArgGis Pro 3.2.2 and my data is in a .gpkg file.
Zooming on the layer works when I add it from manualy(drag and drop form Catalog).
If I do it in my c# code using the CreateLayer, it doesn't work.
EX:
LayerFactory.Instance.CreateLayer(new Uri("C:\Temp\data.gpkg\Name"), map, map.Layers.Count, "name");
Tommy
Hi,
You need to call MapView.Active.ZoomToAsync after creating layer:
var layer = LayerFactory.Instance.CreateLayer(newUri("C:\Temp\data.gpkg\Name"), map, map.Layers.Count, "name");
var fc = (layer as FeatureLayer).GetFeatureClass();
zoomToEnv = fc.GetExtent().Clone() as ArcGIS.Core.Geometry.Envelope;
if (zoomToEnv != null) MapView.Active.ZoomToAsync(zoomToEnv);
Thanks, I can use this to bypass my problem temporarily.
Outside of the c# code, in arcgis pro, if I right click on the layer and click on Zoom on the layer, it doesn't work.
It does a weird zoom out not centered on my polygons.