Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hru-delin-dev
hru-delin-qgis
Commits
466312a0
Unverified
Commit
466312a0
authored
Apr 18, 2020
by
Julien Veyssier
Browse files
zoom on hru.shp at the end
Signed-off-by:
Julien Veyssier
<
eneiluj@posteo.net
>
parent
183da11d
Changes
1
Hide whitespace changes
Inline
Side-by-side
hrudelin_dockwidget.py
View file @
466312a0
...
...
@@ -283,6 +283,7 @@ class HruDelinDockWidget(QtWidgets.QDockWidget, FORM_CLASS):
layerPath
=
params
[
'path'
]
layerName
=
params
[
'name'
]
expanded
=
params
[
'expanded'
]
if
'expanded'
in
params
else
False
zoom
=
params
[
'zoom'
]
if
'zoom'
in
params
else
False
# default tag is 'various'
tag
=
params
[
'tag'
]
if
'tag'
in
params
else
'various'
# if checked not specified : True
...
...
@@ -325,6 +326,10 @@ class HruDelinDockWidget(QtWidgets.QDockWidget, FORM_CLASS):
self
.
tr
(
'item %s not found'
%
layerName
)
)
if
zoom
:
self
.
iface
.
setActiveLayer
(
layer
)
self
.
iface
.
zoomToActiveLayer
()
if
targetProject
is
not
None
:
# we store the layers by tag to be able to remove them later
self
.
layers
[
tag
].
append
(
layer
)
...
...
@@ -997,14 +1002,19 @@ class HruDelinDockWidget(QtWidgets.QDockWidget, FORM_CLASS):
task
.
setProgress
(
progress
)
# display layers
for
fPath
in
[
'hru.shp'
,
'reach.shp'
]:
strPath
=
os
.
path
.
join
(
self
.
cfgResultsOutPath
,
fPath
)
task
.
displayLayer
.
emit
({
'type'
:
'vector'
,
'path'
:
strPath
,
'name'
:
os
.
path
.
basename
(
strPath
),
'tag'
:
'results'
})
task
.
displayLayer
.
emit
({
'type'
:
'vector'
,
'path'
:
os
.
path
.
join
(
self
.
cfgResultsOutPath
,
'hru.shp'
),
'name'
:
'hru.shp'
,
'tag'
:
'results'
,
'zoom'
:
True
})
task
.
displayLayer
.
emit
({
'type'
:
'vector'
,
'path'
:
os
.
path
.
join
(
self
.
cfgResultsOutPath
,
'reach.shp'
),
'name'
:
'reach.shp'
,
'tag'
:
'results'
})
return
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment