Select to view content in your preferred language

Why do layer (.lyrx) files zoom to full extent by default?

1394
6
Jump to solution
03-03-2022 04:14 AM
Labels (1)
ASw93
by
Occasional Contributor

If via the Catalog pane, you drag a feature class from a SQLite source directly onto your map, the extent will automatically zoom appropriately to surround all the features within that feature class, as expected.

If however, you then save that new layer as a .lyrx file and drag that layer onto a map, the extent zooms out to the full extent of the world map. So if your features are specifically in one country, they'd be incredibly small by default and you have to zoom to find them. Even right-clicking the layer and pressing 'Zoom to Layer' zooms to the full world map extent.

My layer was initially setup to source from a geodatabase but I changed it to a new SQLite source. It worked fine with the geodatabase source but now doesn't for SQLite.

I am wondering if it's a bug from ArcGIS Pro or is a SQLite issue? Or is there a way to change the default extent of a layer file (.lyrx)? This isn't very good if giving layer files to clients.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
ASw93
by
Occasional Contributor

This seems to be an ArcGIS Pro 2.9 bug. If you setup the layer to point to a gdb source, and then change that to a sqlite by editing the Layer Properties, it will zoom to the world extent by default rather than the layer extent. So you have to setup the layer from the sqlite source initially for this to work appropriately.

View solution in original post

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

does the same behaviour exist if you "add" the lyrx versus dragging it?  It it behaves properly when you add the lyrx, I suspect that dragging is a just a convenient shortcut and doesn't implement all the processes that may be involved in "add"ing a layer (eg a pre-read of extent if it exists)


... sort of retired...
0 Kudos
ASw93
by
Occasional Contributor

Unfortunately adding a layer via the Add Data method still zooms out to a full extent by default.

0 Kudos
Robert_LeClair
Esri Notable Contributor

So I tested the *.lyrx on a fGDB and a SQLite geodatabase using ArcGIS Pro 2.9.2 and when I add the *.lyrx from either geodatabase type, it performs as expected.  Zooms to the extent of the layer and not the world.  What release of ArcGIS Pro are you using?

0 Kudos
ASw93
by
Occasional Contributor

I'm using 2.9.2.

Definitely something strange going on. I've had it work before so can rule out it being an Arc Pro issue. Not sure why in this case importing the raw feature class zooms to the correct extent, but a layer file connecting to the same feature class doesn't. Any idea if there's any settings in the layer may be causing that?

I've even re-ran the Recalculate Feature Class tool to be sure, but the feature class itself was not showing a problem in the first place.

The layer used to connect to a GDB and was changed to the SQLite source so I am wondering if just playing with the source settings has messed with things. I have over 20 layers doing the same thing here so it's not just a quick fix to one unfortunately.

0 Kudos
DanPatterson
MVP Esteemed Contributor

Set the map extent—ArcGIS Pro | Documentation

try setting an extent to see if it mitigates the behaviour, particularly if you aren't current with the ArcGIS Pro version


... sort of retired...
0 Kudos
ASw93
by
Occasional Contributor

This seems to be an ArcGIS Pro 2.9 bug. If you setup the layer to point to a gdb source, and then change that to a sqlite by editing the Layer Properties, it will zoom to the world extent by default rather than the layer extent. So you have to setup the layer from the sqlite source initially for this to work appropriately.

0 Kudos