Skip to content

Commit

Permalink
Merge pull request #1056 from orangemug/feature/added-circle-translate
Browse files Browse the repository at this point in the history
Added support for `circle-translate`
  • Loading branch information
ahocevar committed Dec 12, 2023
2 parents 7f05482 + dfd1b98 commit b8ead84
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 @@ -1112,6 +1112,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 @@ -1148,11 +1158,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 b8ead84

Please sign in to comment.