Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GéoContrib
Géocontrib Frontend
Commits
9b98de99
Commit
9b98de99
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
prevent featureGeojson not updated if no features existing for project
parent
579e06e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!110
REDMINE_ISSUE-12013
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/views/feature/Feature_list.vue
+9
-8
9 additions, 8 deletions
src/views/feature/Feature_list.vue
src/views/project/Project_detail.vue
+3
-2
3 additions, 2 deletions
src/views/project/Project_detail.vue
with
12 additions
and
10 deletions
src/views/feature/Feature_list.vue
+
9
−
8
View file @
9b98de99
...
@@ -331,10 +331,10 @@ export default {
...
@@ -331,10 +331,10 @@ export default {
},
},
onFilterChange
()
{
onFilterChange
()
{
var
features
=
this
.
filteredFeatures
;
if
(
this
.
featureGroup
)
{
this
.
featureGroup
.
clearLayers
()
;
const
features
=
this
.
filteredFeatures
;
this
.
featureGroup
=
mapUtil
.
addFeatures
(
features
,
{}
);
this
.
featureGroup
.
clearLayers
(
);
if
(
features
.
length
>
0
)
{
this
.
featureGroup
=
mapUtil
.
addFeatures
(
features
,
{});
mapUtil
mapUtil
.
getMap
()
.
getMap
()
.
fitBounds
(
this
.
featureGroup
.
getBounds
(),
{
padding
:
[
25
,
25
]
});
.
fitBounds
(
this
.
featureGroup
.
getBounds
(),
{
padding
:
[
25
,
25
]
});
...
@@ -365,15 +365,16 @@ export default {
...
@@ -365,15 +365,16 @@ export default {
});
});
// --------- End sidebar events ----------
// --------- End sidebar events ----------
if
(
this
.
$store
.
state
.
map
.
geojsonFeatures
)
{
if
(
this
.
features
&&
this
.
features
.
length
>
0
)
{
this
.
loadFeatures
(
this
.
$store
.
state
.
map
.
geojsonFeatures
);
//* features are updated consistently, then if features exists, we can fetch the geojson version
}
else
{
const
url
=
`
${
this
.
$store
.
state
.
configuration
.
VUE_APP_DJANGO_API_BASE
}
projects/
${
this
.
$route
.
params
.
slug
}
/feature/?output=geojson`
;
const
url
=
`
${
this
.
$store
.
state
.
configuration
.
VUE_APP_DJANGO_API_BASE
}
projects/
${
this
.
$route
.
params
.
slug
}
/feature/?output=geojson`
;
this
.
featureLoading
=
true
;
this
.
featureLoading
=
true
;
axios
axios
.
get
(
url
)
.
get
(
url
)
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
this
.
loadFeatures
(
response
.
data
.
features
);
if
(
response
.
status
===
200
&&
response
.
data
.
features
.
length
>
0
)
{
this
.
loadFeatures
(
response
.
data
.
features
);
}
this
.
featureLoading
=
false
;
this
.
featureLoading
=
false
;
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/views/project/Project_detail.vue
+
3
−
2
View file @
9b98de99
...
@@ -590,7 +590,6 @@ export default {
...
@@ -590,7 +590,6 @@ export default {
if
(
this
.
project
&&
this
.
permissions
.
can_view_project
)
{
if
(
this
.
project
&&
this
.
permissions
.
can_view_project
)
{
this
.
$store
.
dispatch
(
"
map/INITIATE_MAP
"
);
this
.
$store
.
dispatch
(
"
map/INITIATE_MAP
"
);
const
url
=
`
${
this
.
$store
.
state
.
configuration
.
VUE_APP_DJANGO_API_BASE
}
projects/
${
this
.
$route
.
params
.
slug
}
/feature/?output=geojson`
;
const
url
=
`
${
this
.
$store
.
state
.
configuration
.
VUE_APP_DJANGO_API_BASE
}
projects/
${
this
.
$route
.
params
.
slug
}
/feature/?output=geojson`
;
let
self
=
this
;
axios
axios
.
get
(
url
)
.
get
(
url
)
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
...
@@ -600,7 +599,9 @@ export default {
...
@@ -600,7 +599,9 @@ export default {
mapUtil
mapUtil
.
getMap
()
.
getMap
()
.
fitBounds
(
featureGroup
.
getBounds
(),
{
padding
:
[
25
,
25
]
});
.
fitBounds
(
featureGroup
.
getBounds
(),
{
padding
:
[
25
,
25
]
});
self
.
$store
.
commit
(
"
map/SET_GEOJSON_FEATURES
"
,
features
);
this
.
$store
.
commit
(
"
map/SET_GEOJSON_FEATURES
"
,
features
);
}
else
{
this
.
$store
.
commit
(
"
map/SET_GEOJSON_FEATURES
"
,
[]);
}
}
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment