Select to view content in your preferred language

FullExtent returning 180, 90, -180, -90 and not actual min/max coordinates of layer

1057
3
02-12-2020 07:16 AM
KeithMcCall
Emerging Contributor

In the following code on SDK 100.xxx on an IOS device, FullExtent is populated to 180, 90, -180, -90 which does not really help when you're trying to zoom to a layer.

FullExtent for this layer should be returning 18.8404922485352, -33.0619621276855, 18.8464298248291, -33.0554275512695

The KMZ layer loads and displays on the SceneView no problem.

The below code snippet results in:

2020-02-12 07:08:50.546 PrecisionView[779:912352] Extent: Xmax 180, Ymax 90, Xmin -180, Ymin -90

As a workaround, I'm having to load and read the coordinates from the actual file which is an unnecessary performance hit. 

Is FullExtent not populating a known bug or what am I missing to get FullExtent of a layer to populate correctly?

************************************************************

bool extenthasvalues = false;

Console.WriteLine("Loading layer...");
await Layer.Layer.Dataset.LoadAsync(); // Wait for layer data to load in

var extent = Layer.Layer.FullExtent;
Console.WriteLine("Extent: Xmax {0}, Ymax {1}, Xmin {2}, Ymin {3}", extent.XMax, extent.YMax, extent.XMin, extent.YMin);
if (extent.XMax != 180) // Addressing bug in Arcgis
{
r.maxLatitude = extent.XMax;
r.maxLongitude = extent.YMax;
r.minLatitude = extent.XMin;
r.minLongitude = extent.YMin;
extenthasvalues = true;
}

if (!extenthasvalues)
{
Console.WriteLine("Fullextent has no values. Getting coordinates from {0}...", Layer.UriPath);

if (Layer.Coordinates == null)
{
Layer.Coordinates = LoadCoordinatesFromUri(Layer);
}

r = KML.GetRange(Layer.Coordinates);
}

************************************************************

0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor

Can you share the KMZ so we can take a look?

Is the extent you expected defined in the KML inside the KMZ?

0 Kudos
KeithMcCall
Emerging Contributor

Hi Morten,

Here's a link to the KMZ file:

http://images.pollensystems.com/kml/arcgis_extent_error.kmz 

Thanks for any assistance!

Keith

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Keith,

What version of the API are you using?

Cheers

Mike

0 Kudos