From dfd1b98e0ab9560d185508790ea965e6c722ef68 Mon Sep 17 00:00:00 2001 From: orangemug Date: Tue, 12 Dec 2023 14:29:32 +0000 Subject: [PATCH] Added circle-translate styling rule. --- src/stylefunction.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/stylefunction.js b/src/stylefunction.js index 040da6b7..8d476b4f 100644 --- a/src/stylefunction.js +++ b/src/stylefunction.js @@ -1111,6 +1111,16 @@ export function stylefunction( featureState ) ); + + const circleTranslate = getValue( + layer, + 'paint', + 'circle-translate', + zoom, + f, + functionCache, + featureState + ); const circleColor = colorWithOpacity( getValue( layer, @@ -1147,11 +1157,17 @@ export function stylefunction( '.' + circleColor + '.' + - circleStrokeWidth; + circleStrokeWidth + + '.' + + circleTranslate[0] + + '.' + + circleTranslate[1]; + iconImg = iconImageCache[cache_key]; if (!iconImg) { iconImg = new Circle({ radius: circleRadius, + displacement: [circleTranslate[0], -circleTranslate[1]], stroke: circleStrokeColor && circleStrokeWidth > 0 ? new Stroke({