Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I change the icon of the feature while using the featureAnimation.Path? #1036

Open
yk-jo opened this issue Mar 8, 2024 · 7 comments
Open

Comments

@yk-jo
Copy link

yk-jo commented Mar 8, 2024

I'm using featureAnimation.Path because I want it to work as an animation whenever the coordinates of feature change on the map.

However, among the functions I have to implement, the icon of the feature must change if I move more than a certain distance.

Is there a way to implement this feature?

@Viglino
Copy link
Owner

Viglino commented Mar 12, 2024

I've added a new drawing event to let you change the style before drawing the feature on the map:

anim.on('drawing', function(e) {
  if (e.time > 5000) {
     e.style = styleRed;
  } else {
     e.style = styleBlue;
  }
})

Tell me if it's good for you.

@yk-jo
Copy link
Author

yk-jo commented Mar 12, 2024

스크린샷 2024-03-12 오후 5 51 02

It seems to add the values of e.rotation and e.style to the same key.

If I want to apply a different style for each angle, should I proceed with branching using the e.rotation value?

@Viglino
Copy link
Owner

Viglino commented Mar 12, 2024

@yk-jo
Copy link
Author

yk-jo commented Mar 12, 2024

Thank you so much!
Could you please proceed with the deployment so that I can get an update from React?

@Viglino
Copy link
Owner

Viglino commented Mar 12, 2024

v4.0.17 is out

@yk-jo
Copy link
Author

yk-jo commented Mar 13, 2024

Thank you. I'm trying out the features you updated.
But when I try to set the style I want to use, there's a phenomenon where it's empty because it doesn't render and then reappears when the animation ends.

@Viglino
Copy link
Owner

Viglino commented Mar 13, 2024

Do you have an online example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants