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
5b9d3a4c
Commit
5b9d3a4c
authored
2 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
fix error of duplicating a layer after dragging, if same layer found in different basemaps
parent
b07d85d3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/Map/LayerSelector.vue
+3
-2
3 additions, 2 deletions
src/components/Map/LayerSelector.vue
src/components/Map/SidebarLayers.vue
+6
-6
6 additions, 6 deletions
src/components/Map/SidebarLayers.vue
with
9 additions
and
8 deletions
src/components/Map/LayerSelector.vue
+
3
−
2
View file @
5b9d3a4c
...
...
@@ -28,8 +28,8 @@
:data-basemap-index="basemap.id"
>
<div
v-for=
"
(
layer
, index)
in basemap.layers"
:key=
"basemap.id + '-' + layer.id
+ '-' + index
"
v-for=
"layer in basemap.layers"
:key=
"basemap.id + '-' + layer.id"
class=
"layer-item transition visible item list-group-item"
:data-id=
"layer.id"
>
...
...
@@ -108,6 +108,7 @@ export default {
},
mounted
()
{
this
.
basemapLayers
=
[...
this
.
basemap
.
layers
];
setTimeout
(
this
.
initSortable
.
bind
(
this
),
1000
);
},
...
...
This diff is collapsed.
Click to expand it.
src/components/Map/SidebarLayers.vue
+
6
−
6
View file @
5b9d3a4c
...
...
@@ -235,16 +235,16 @@ export default {
},
onlayerMove
()
{
// Get
the name
s of the
current
layers in order.
const
currentLayers
Names
InOrder
=
Array
.
from
(
document
.
getElementsByClassName
(
'
layer-item
transition
visible
'
)
// Get
id
s of the
draggable
layers in
its current
order.
const
currentLayers
Id
InOrder
=
Array
.
from
(
document
.
querySelectorAll
(
'
.content.active .
layer-item
.
transition
.
visible
'
)
).
map
((
el
)
=>
parseInt
(
el
.
attributes
[
'
data-id
'
].
value
));
// Create an array to put the
layers in
order.
// Create an array to put the
original layers in the same
order.
let
movedLayers
=
[];
for
(
const
layer
Name
of
currentLayers
Names
InOrder
)
{
for
(
const
layer
Id
of
currentLayers
Id
InOrder
)
{
movedLayers
.
push
(
this
.
activeBasemap
.
layers
.
find
((
el
)
=>
el
.
id
===
layer
Name
)
this
.
activeBasemap
.
layers
.
find
((
el
)
=>
el
.
id
===
layer
Id
)
);
}
// Remove existing layers undefined
...
...
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