Skip to content

Commit

Permalink
Added circle-translate styling rule.
Browse files Browse the repository at this point in the history
  • Loading branch information
orangemug committed Dec 12, 2023
1 parent 206396b commit dfd1b98
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/stylefunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,16 @@ export function stylefunction(
featureState
)
);

const circleTranslate = getValue(
layer,
'paint',
'circle-translate',
zoom,
f,
functionCache,
featureState
);
const circleColor = colorWithOpacity(
getValue(
layer,
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit dfd1b98

Please sign in to comment.