The table Extent property is showing Envelope [XMin=NaN, YMin=NaN, XMax=NaN, YMax=NaN, Wkid=3857]. This is also what the FullExtent of the layer shows. I've tried with several different files. It's evident that the map can determine the full extent since it loads the layer at the full extent. In addition, I can load the layer as a dynamic map service layer and query the metadata to determine the full extent. Is there another way to get at this information when directly loading a shapefile?
Note: I see the same issue when using GeodatabaseFeatureTable
Solved! Go to Solution.
Hi Mike,
Thank you for reporting this bug. I'm able to reproduce the issue.
You can however, do the following to get the FullExtent.
var table = await ShapefileTable.OpenAsync(@"C:\Users\jenn6286\Downloads\states_21basic\states.shp");
var features = await table.QueryAsync(new QueryFilter(){WhereClause= "1=1"});
if (features != null)
{
Envelope fullExtent = GeometryEngine.Union(from f in features
where f.Geometry != null
select f.Geometry).Extent;
}
If you wanted current extent, you can use SpatialQueryFilter with Geometry=MapView.Extent.
Hi Mike,
Thank you for reporting this bug. I'm able to reproduce the issue.
You can however, do the following to get the FullExtent.
var table = await ShapefileTable.OpenAsync(@"C:\Users\jenn6286\Downloads\states_21basic\states.shp");
var features = await table.QueryAsync(new QueryFilter(){WhereClause= "1=1"});
if (features != null)
{
Envelope fullExtent = GeometryEngine.Union(from f in features
where f.Geometry != null
select f.Geometry).Extent;
}
If you wanted current extent, you can use SpatialQueryFilter with Geometry=MapView.Extent.