Skip to content

Commit

Permalink
Setting the extent of the layer using the defined spatial_extent befo…
Browse files Browse the repository at this point in the history
…re adding to the map (#300)

* Setting the extent of the layer using the defined spatial_extent

---------

Co-authored-by: G.Allegri <[email protected]>
  • Loading branch information
Gpetrak and giohappy authored Nov 27, 2024
1 parent b9175d3 commit 3c0c242
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ pytest-custom-exit-code = "^0.3.0"
mypy = "^1.0.0"
qgis-stubs = "^0.2.0.post1"
PyQt5-stubs = "^5.15.6.0"
PyQt5-Qt5 = "5.15.2"
PyQt5 = "5.15.6"
PyQt5-Qt5 = {version = "5.15.2", platform = "win32"}
PyQt5 = {version = "5.15.6", platform = "win32"}

[tool.poetry.dev-dependencies]

Expand Down
3 changes: 3 additions & 0 deletions src/qgis_geonode/gui/search_result_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ def add_layer_to_project(self):
self.handle_loading_error
)
self.api_client.style_detail_error_received.disconnect(self.handle_style_error)

# Set the final extent using the defined spatial_extent
self.layer.setExtent(self.brief_dataset.spatial_extent)
self.project.addMapLayer(self.layer)
self.handle_layer_load_end()

Expand Down

0 comments on commit 3c0c242

Please sign in to comment.