Skip to content

Commit b8ead84

Browse files
authored
Merge pull request #1056 from orangemug/feature/added-circle-translate
Added support for `circle-translate`
2 parents 7f05482 + dfd1b98 commit b8ead84

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
@@ -1112,6 +1112,16 @@ export function stylefunction(
11121112
featureState
11131113
)
11141114
);
1115+
1116+
const circleTranslate = getValue(
1117+
layer,
1118+
'paint',
1119+
'circle-translate',
1120+
zoom,
1121+
f,
1122+
functionCache,
1123+
featureState
1124+
);
11151125
const circleColor = colorWithOpacity(
11161126
getValue(
11171127
layer,
@@ -1148,11 +1158,17 @@ export function stylefunction(
11481158
'.' +
11491159
circleColor +
11501160
'.' +
1151-
circleStrokeWidth;
1161+
circleStrokeWidth +
1162+
'.' +
1163+
circleTranslate[0] +
1164+
'.' +
1165+
circleTranslate[1];
1166+
11521167
iconImg = iconImageCache[cache_key];
11531168
if (!iconImg) {
11541169
iconImg = new Circle({
11551170
radius: circleRadius,
1171+
displacement: [circleTranslate[0], -circleTranslate[1]],
11561172
stroke:
11571173
circleStrokeColor && circleStrokeWidth > 0
11581174
? new Stroke({

0 commit comments

Comments
 (0)