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
externe Matthieu
Géocontrib Frontend
Commits
03f00f81
Commit
03f00f81
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
add features to map, working with datas from django
parent
895b5a44
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/assets/js/map-util.js
+1
-0
1 addition, 0 deletions
src/assets/js/map-util.js
src/store/modules/feature.js
+5
-1
5 additions, 1 deletion
src/store/modules/feature.js
with
6 additions
and
1 deletion
src/assets/js/map-util.js
+
1
−
0
View file @
03f00f81
...
@@ -259,6 +259,7 @@ const mapUtil = {
...
@@ -259,6 +259,7 @@ const mapUtil = {
if
(
!
filter
||
!
Object
.
values
(
filter
).
some
(
val
=>
val
)
||
Object
.
values
(
filter
).
some
(
val
=>
val
)
&&
filters
.
length
&&
filters
.
every
(
val
=>
val
!==
false
))
{
if
(
!
filter
||
!
Object
.
values
(
filter
).
some
(
val
=>
val
)
||
Object
.
values
(
filter
).
some
(
val
=>
val
)
&&
filters
.
length
&&
filters
.
every
(
val
=>
val
!==
false
))
{
const
geomJSON
=
flip
(
feature
.
geometry
);
const
geomJSON
=
flip
(
feature
.
geometry
);
//const geomJSON = flip(feature.geom); //* different name in data from django api
const
popupContent
=
this
.
_createContentPopup
(
feature
);
const
popupContent
=
this
.
_createContentPopup
(
feature
);
...
...
This diff is collapsed.
Click to expand it.
src/store/modules/feature.js
+
5
−
1
View file @
03f00f81
...
@@ -91,7 +91,11 @@ const feature = {
...
@@ -91,7 +91,11 @@ const feature = {
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
const
features
=
response
.
data
.
features
;
const
features
=
response
.
data
.
features
;
commit
(
"
SET_FEATURES
"
,
features
);
commit
(
"
SET_FEATURES
"
,
features
);
dispatch
(
"
map/ADD_FEATURES
"
,
features
,
{
root
:
true
});
dispatch
(
"
map/ADD_FEATURES
"
,
features
.
map
(
el
=>
{
const
geometry
=
el
.
geom
;
const
properties
=
{
...
el
}
return
{
geometry
,
properties
}
}),
{
root
:
true
});
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
throw
error
;
throw
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