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

Animations not working when zooming #67

Open
benb545 opened this issue May 8, 2023 · 0 comments
Open

Animations not working when zooming #67

benb545 opened this issue May 8, 2023 · 0 comments

Comments

@benb545
Copy link

benb545 commented May 8, 2023

https://gyazo.com/5e24d35d712bc53c98bd9654bae3ca8a

I think this is because the length of the path does not change during zoom, so when I zoom in, its so long that you don't see the animation, and then its smaller, you see small chunks of paths moving.

My code:

`
const attackerIcon = LeafletMap.divIcon({
className: 'attacker',
html: '

'
});
LeafletMap.marker([41.224374, 0.145053], {icon: attackerIcon}).addTo(this.map);

      LeafletMap.curve(['M', [41.224374, 0.145053],
        'C', [47.387311, 21.503481],
        [45.406853, 38.448971],
        [32.638331, 36.582095]], { animate: {duration: 1600, iterations: Infinity, easting: 'ease-in-out'} }).addTo(this.map);

      const target1 = LeafletMap.divIcon({
        className: 'target',
        html: '<div></div>'
      });
      LeafletMap.marker([32.638331, 36.582095], {icon: target1}).addTo(this.map);

      LeafletMap.curve(['M', [41.224374, 0.145053],
        'C', [44.285435, -25.579085],
        [31.887952, -66.536115],
        [6.414813, -73.040021]], { animate: {duration: 1600, iterations: Infinity, easting: 'ease-in-out'} }).addTo(this.map);

      const target2 = LeafletMap.divIcon({
        className: 'target',
        html: '<div></div>'
      });
      LeafletMap.marker([6.414813, -73.040021], {icon: target2}).addTo(this.map);

`

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

No branches or pull requests

1 participant