From c43c6c2ed09fdad149771279cb82b4a2bcd5234a Mon Sep 17 00:00:00 2001 From: Joaquim Nallar Date: Tue, 19 Mar 2024 09:40:03 +0100 Subject: [PATCH] fix: Others color config to use with leaflet overlay --- CHANGES.md | 4 ++++ mapentity/static/mapentity/mapentity.detail.js | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dbca1b2c..a8334cb6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,10 @@ CHANGELOG 8.7.1+dev (XXXX-XX-XX) ----------------------- +**Bug fixes** + +- 'Others' color config to use with leaflet overlay (#290) + 8.7.1 (2024-03-13) ------------------- diff --git a/mapentity/static/mapentity/mapentity.detail.js b/mapentity/static/mapentity/mapentity.detail.js index 4edf589b..bc19b9dd 100644 --- a/mapentity/static/mapentity/mapentity.detail.js +++ b/mapentity/static/mapentity/mapentity.detail.js @@ -17,8 +17,14 @@ $(document).ready(function () { var loaded_layer = false; var map = data.map; - var style = L.Util.extend({ clickable: false }, - window.SETTINGS.map.styles[modelname] || {}); + + var style = window.SETTINGS.map.styles[modelname]; + if (style === undefined) { + style = window.SETTINGS.map.styles.others; + } + if (!(typeof window.SETTINGS.map.styles.others === "function")) { + var style = L.Util.extend({}, style); + } var layer = new L.ObjectsLayer(null, { modelname: modelname,