Skip to content

Commit

Permalink
Merge pull request #953 from terrestris/fixanimateutil
Browse files Browse the repository at this point in the history
fix: moveFeature in AnimateUtil
  • Loading branch information
weskamm authored Feb 17, 2023
2 parents 79c2462 + c35ca3b commit 4519898
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/AnimateUtil/AnimateUtil.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _isFunction from 'lodash/isFunction';
import _isNil from 'lodash/isNil';
import OlFeature from 'ol/Feature';
import OlGeometry from 'ol/geom/Geometry';
Expand Down Expand Up @@ -66,7 +67,11 @@ class AnimateUtil {
geometry.translate(deltaX, deltaY);

if (style) {
vectorContext.setStyle(style);
if (_isFunction(style)) {
vectorContext.setStyle(style(featureToMove));
} else {
vectorContext.setStyle(style);
}
}
vectorContext.drawGeometry(geometry);

Expand Down

0 comments on commit 4519898

Please sign in to comment.