From 9ddb47686c8b8c010d39658475bc13d8210deefc Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Thu, 11 Jan 2024 11:39:19 -0700 Subject: [PATCH] Adding better color support for GeoJSON shapes on map --- .../computate/frFR/java/EcrirePageClasse.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/computate/frFR/java/EcrirePageClasse.java b/src/main/java/org/computate/frFR/java/EcrirePageClasse.java index ad5b68e0..dd217386 100644 --- a/src/main/java/org/computate/frFR/java/EcrirePageClasse.java +++ b/src/main/java/org/computate/frFR/java/EcrirePageClasse.java @@ -3262,19 +3262,25 @@ else if(entiteAttribuer) { tl(4, "if(feature.geometry.type == 'Point') {"); tl(5, "return {"); tl(6, "radius: 8"); - tl(6, ", fillColor: '#ff7800'"); - tl(6, ", color: '#000'"); + tl(6, ", fillColor: (feature.properties.areaServedColors && feature.properties.areaServedColors[feature.index] ? feature.properties.areaServedColors[feature.index] : (feature.properties.color ? feature.properties.color : '#000'))"); + tl(6, ", color: (feature.properties.areaServedColors && feature.properties.areaServedColors[feature.index] ? feature.properties.areaServedColors[feature.index] : (feature.properties.color ? feature.properties.color : '#000'))"); tl(6, ", weight: 1"); - tl(6, ", opacity: 1"); - tl(6, ", fillOpacity: 0.8"); + tl(6, ", opacity: 0.7"); + tl(6, ", fillOpacity: 0.7"); + tl(5, "};"); + tl(4, "} else if(feature.geometry.type == 'LineString') {"); + tl(5, "return {"); + tl(6, "color: (feature.properties.areaServedColors && feature.properties.areaServedColors[feature.index] ? feature.properties.areaServedColors[feature.index] : (feature.properties.color ? feature.properties.color : '#000'))"); + tl(6, ", weight: 5"); + tl(6, ", opacity: 0.7"); tl(5, "};"); tl(4, "} else {"); tl(5, "return {"); - tl(6, " fillColor: '#ff7800'"); + tl(6, " fillColor: (feature.properties.areaServedColors && feature.properties.areaServedColors[feature.index] ? feature.properties.areaServedColors[feature.index] : (feature.properties.color ? feature.properties.color : '#000'))"); tl(6, ", color: (feature.properties.areaServedColors && feature.properties.areaServedColors[feature.index] ? feature.properties.areaServedColors[feature.index] : (feature.properties.color ? feature.properties.color : '#000'))"); - tl(6, ", weight: 5"); - tl(6, ", opacity: 1"); - tl(6, ", fillOpacity: 0.8"); + tl(6, ", weight: 3"); + tl(6, ", opacity: 0.7"); + tl(6, ", fillOpacity: 0.7"); tl(5, "};"); tl(4, "}"); tl(0, "{{/inline}}");