I am running a python script in QGIS 3.8.3-Zanzibar where I am changing the source of a GeoJson file.
I am calling layer.reload()
but subsequent calls to layer.extent()
still return the old extent. I can open the attribute table and zoom to the location and see the selected outline.
But the actual layer symbol does not display.
Things that I've tried:
- I turned off canvas caching to rule that out.
I have tried these statements (in a variety of combinations):
layer.reload()
layer.triggerRepaint()
layer.setDataSource( layer.source(), layer.name(), layer.providerType() )
I figure I'm missing something easy.
layer.updateExtents()