From 2bee5f8a9011e892839313847d7e047c51adbbf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9cile=20Vuilleumier?= Date: Mon, 27 Sep 2021 08:52:48 +0200 Subject: [PATCH] Add support for symbol transparency (#10) --- bridgestyle/arcgis/togeostyler.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bridgestyle/arcgis/togeostyler.py b/bridgestyle/arcgis/togeostyler.py index 7f3fa4c..2399c06 100644 --- a/bridgestyle/arcgis/togeostyler.py +++ b/bridgestyle/arcgis/togeostyler.py @@ -352,10 +352,14 @@ def processSymbolLayer(layer, symboltype, options): fillOpacity = 1.0 strokeOpacity = 0 strokeWidth = 0.0 + try: + opacity = layer["symbol"]["symbolLayers"][0].get("color").get("values")[3]/100 + except (KeyError, IndexError): + opacity = 1.0 return { "opacity": 1.0, - "fillOpacity": fillOpacity, - "strokeOpacity": strokeOpacity, + "fillOpacity": opacity, + "strokeOpacity": opacity, "strokeWidth": strokeWidth, "rotate": rotate, "kind": "Mark",