From aced066c243fb6e0f458b2c8fb912a4250ad5689 Mon Sep 17 00:00:00 2001 From: Joaquim Nallar Date: Wed, 20 Mar 2024 15:14:07 +0100 Subject: [PATCH] fix: current object not mixed with other overlays (#292) --- CHANGES.md | 1 + mapentity/static/mapentity/mapentity.detail.js | 6 ------ mapentity/static/mapentity/mapentity.forms.js | 4 ---- mapentity/static/mapentity/mapentity.map.js | 4 ---- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a8334cb6f..a30d11012 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ CHANGELOG **Bug fixes** - 'Others' color config to use with leaflet overlay (#290) +- Current object not mixed with other overlays (#292) 8.7.1 (2024-03-13) ------------------- diff --git a/mapentity/static/mapentity/mapentity.detail.js b/mapentity/static/mapentity/mapentity.detail.js index dd2396617..cfedc70e9 100644 --- a/mapentity/static/mapentity/mapentity.detail.js +++ b/mapentity/static/mapentity/mapentity.detail.js @@ -33,12 +33,6 @@ $(document).ready(function () { }); map.layerscontrol.addOverlay(layer, objectsname, verbosename); - // Change the group layer "verbosename" (current object list) in first position - var allOverlaysLayers = document.getElementsByClassName('leaflet-control-layers-overlays')[0]; - if (allOverlaysLayers) { - allOverlaysLayers.insertBefore(allOverlaysLayers.lastChild, allOverlaysLayers.firstChild); - } - // Add object family layer (without current object) map.on('layeradd', function (e) { var options = e.layer.options || { 'modelname': 'None' }; diff --git a/mapentity/static/mapentity/mapentity.forms.js b/mapentity/static/mapentity/mapentity.forms.js index 6212237f4..36241e22b 100644 --- a/mapentity/static/mapentity/mapentity.forms.js +++ b/mapentity/static/mapentity/mapentity.forms.js @@ -73,10 +73,6 @@ MapEntity.GeometryField = L.GeometryField.extend({ var nameHTML = ' ' + objectsname; map.layerscontrol.addOverlay(objectsLayer, nameHTML, tr("Objects")) - // Change the group layer "Objects" (current object list) in first position - var allOverlaysLayers = document.getElementsByClassName('leaflet-control-layers-overlays')[0]; - allOverlaysLayers.insertBefore(allOverlaysLayers.lastChild, allOverlaysLayers.firstChild); - var url = this.modelLayerUrl(); objectsLayer.load(url); }, diff --git a/mapentity/static/mapentity/mapentity.map.js b/mapentity/static/mapentity/mapentity.map.js index 670e70139..20086a9ff 100644 --- a/mapentity/static/mapentity/mapentity.map.js +++ b/mapentity/static/mapentity/mapentity.map.js @@ -348,10 +348,6 @@ $(window).on('entity:map:list', function (e, data) { } ); - // Change the group layer "Objects" (current object list) in first position - var allOverlaysLayers = document.getElementsByClassName('leaflet-control-layers-overlays')[0]; - allOverlaysLayers.insertBefore(allOverlaysLayers.lastChild, allOverlaysLayers.firstChild); - $(window).unload(function () { MapEntity.Context.saveFullContext(map, { filter: '#mainfilter',