Skip to content

Commit dfd1b98

Browse files
committed
Added circle-translate styling rule.
1 parent 206396b commit dfd1b98

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/stylefunction.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,16 @@ export function stylefunction(
11111111
featureState
11121112
)
11131113
);
1114+
1115+
const circleTranslate = getValue(
1116+
layer,
1117+
'paint',
1118+
'circle-translate',
1119+
zoom,
1120+
f,
1121+
functionCache,
1122+
featureState
1123+
);
11141124
const circleColor = colorWithOpacity(
11151125
getValue(
11161126
layer,
@@ -1147,11 +1157,17 @@ export function stylefunction(
11471157
'.' +
11481158
circleColor +
11491159
'.' +
1150-
circleStrokeWidth;
1160+
circleStrokeWidth +
1161+
'.' +
1162+
circleTranslate[0] +
1163+
'.' +
1164+
circleTranslate[1];
1165+
11511166
iconImg = iconImageCache[cache_key];
11521167
if (!iconImg) {
11531168
iconImg = new Circle({
11541169
radius: circleRadius,
1170+
displacement: [circleTranslate[0], -circleTranslate[1]],
11551171
stroke:
11561172
circleStrokeColor && circleStrokeWidth > 0
11571173
? new Stroke({

0 commit comments

Comments
 (0)