Skip to content
Snippets Groups Projects
Commit 505ac2d6 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

Merge branch 'redmine-issues/16324' into 'develop'

REDMINE_ISSUE-16324|Customisation fond de cartes - duplication de couche et ordre incorrect

See merge request !548
parents b07d85d3 3b7e64d6
No related branches found
No related tags found
No related merge requests found
......@@ -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"
>
......
......@@ -235,16 +235,16 @@ export default {
},
onlayerMove() {
// Get the names of the current layers in order.
const currentLayersNamesInOrder = Array.from(
document.getElementsByClassName('layer-item transition visible')
// Get ids of the draggable layers in its current order.
const currentLayersIdInOrder = 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 layerName of currentLayersNamesInOrder) {
for (const layerId of currentLayersIdInOrder) {
movedLayers.push(
this.activeBasemap.layers.find((el) => el.id === layerName)
this.activeBasemap.layers.find((el) => el.id === layerId)
);
}
// Remove existing layers undefined
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment