How to refresh feature layer extent

697
1
08-27-2020 11:35 PM
by Anonymous User
Not applicable

I am using the QML api. I load a GeoPackage into a feature layer and successfully load it onto the map and can see the polygons contained in the feature table on the map.

While the app is still open, I also open the GeoPackage up in Pro and add a new feature.

If I add the feature 'within' the current extent of the layer, a simple zoom in or out back in my app refreshes the layer in the app and displays the new feature at all map scales.

However, if I try to add a new feature 'outside' the current extent of the layer, the new feature does NOT appear, unless (for some weird reason) I zoom waaaay out. If I zoom out far enough (and I've drawn a big enough polygon that I can still see it at that scale) eventually the new feature pops into view. But if I zoom back in it then disappears.

So, I know that the new feature has successfully been saved within the GeoPackage database itself, and must be present in the corresponding GeoPackageFeatureTable. But I'm not sure what's going on with the layer and the map itself.

Is there someway I can force a refresh of the layer extent? Or any other suggestions on what might be going on?

I tried playing with the renderingMode and setting it to Enums.FeatureRenderingModeDynamic, but then I got some weird results where sometimes the new feature appeared and sometimes not and I couldn't pin down a pattern.

0 Kudos
1 Reply
by Anonymous User
Not applicable

I realise this one might be a bit hard to follow, so here is a link to a short 34sec video showing what I mean...

AppStudio - GeoPackage new features no displaying - YouTube 

0 Kudos