From 5add4f16cbf1951b80f51faee4e80e4d64ab775d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Viricel?= Date: Wed, 5 Feb 2025 14:38:15 +0100 Subject: [PATCH] feat: add feature color_fill into accepted cluster colors #457 --- components/MainMap/MapFeatures.vue | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/components/MainMap/MapFeatures.vue b/components/MainMap/MapFeatures.vue index e064c782..36d44715 100644 --- a/components/MainMap/MapFeatures.vue +++ b/components/MainMap/MapFeatures.vue @@ -258,13 +258,10 @@ export default defineNuxtComponent({ }, onMapStyleLoad() { - const colors = [ - ...new Set( - this.categories - .filter(category => category.category) - .map(category => category.category.color_fill), - ), - ] + const categoryColors = this.categories.filter(category => category.category).map(category => category.category.color_fill) + const featureColors = this.features.filter(feature => feature.properties.display).map(feature => feature.properties.display!.color_fill) + const colors = [...new Set([...categoryColors, ...featureColors])] + this.mapBase!.initPoiLayer(this.features, colors, [ 'case', ['all', ['has', 'display'], ['has', 'color_fill', ['get', 'display']]],