Igor-Vladyka / leaflet.motion

A simple tool to animate polylines and polygons in different way
https://igor-vladyka.github.io/leaflet.motion/
MIT License
205 stars 44 forks source link

Support for Angular? #6

Open Stan92 opened 5 years ago

Stan92 commented 5 years ago

Hi, Is it possible to use this plugin with Angular? Thx

Igor-Vladyka commented 5 years ago

Hi, yes, It definitelly possible. You can just google how to do it ;)

petterw03 commented 5 years ago

If you use webpack, you will probably want to import it like this: import 'leaflet.motion/dist/leaflet.motion.js'

Stan92 commented 5 years ago

The import works but doesn’t work as expected I’ve found this tutorial and going to see if It can be done with my skills https://github.com/Asymmetrik/ngx-leaflet-tutorial-plugins

Igor-Vladyka commented 4 years ago

@Stan92 Have you managed to import it properly intu Angular? Please let us know your solution.

minhproc1 commented 4 years ago

I have imported it into Angular successfully but with a little hacky way. First you need to import 'leaflet.motion/dist/leaflet.motion.js' directly to the component you're working on (usually map component) Then, whenever you call L.motion.polyline or L.Motion,etc... you need to change to (L as any).motion... Because TypeScript is a strongly-typed superset of JavaScript so it won't let you compile and will popup this error: "Property 'motion' does not exist on type 'typeof import".

dishubagga commented 3 years ago

I have imported it into Angular successfully but with a little hacky way. First you need to import 'leaflet.motion/dist/leaflet.motion.js' directly to the component you're working on (usually map component) Then, whenever you call L.motion.polyline or L.Motion,etc... you need to change to (L as any).motion... Because TypeScript is a strongly-typed superset of JavaScript so it won't let you compile and will popup this error: "Property 'motion' does not exist on type 'typeof import".

Thanks for the solution buddy!

KondakovAl commented 1 year ago

I have imported it into Angular successfully but with a little hacky way. First you need to import 'leaflet.motion/dist/leaflet.motion.js' directly to the component you're working on (usually map component) Then, whenever you call L.motion.polyline or L.Motion,etc... you need to change to (L as any).motion... Because TypeScript is a strongly-typed superset of JavaScript so it won't let you compile and will popup this error: "Property 'motion' does not exist on type 'typeof import".

Bro, thanks a lot! Used this plugin with React

arnovr commented 2 months ago

I am using it in angular 18. The suggested import didn't work for me, got webpack eval errors after production build. Importing the min.js worked for me: import 'leaflet.motion/dist/leaflet.motion.min.js'

(L as any).motion.polyline().....

erulan14 commented 2 months ago

I have imported it into Angular successfully but with a little hacky way. First you need to import 'leaflet.motion/dist/leaflet.motion.js' directly to the component you're working on (usually map component) Then, whenever you call L.motion.polyline or L.Motion,etc... you need to change to (L as any).motion... Because TypeScript is a strongly-typed superset of JavaScript so it won't let you compile and will popup this error: "Property 'motion' does not exist on type 'typeof import".

Bro, thanks a lot! Used this plugin with React

Bro, as you used in React, is it possible to use in react-leaflet ?