Open Stan92 opened 5 years ago
Hi, yes, It definitelly possible. You can just google how to do it ;)
If you use webpack, you will probably want to import it like this:
import 'leaflet.motion/dist/leaflet.motion.js'
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
@Stan92 Have you managed to import it properly intu Angular? Please let us know your solution.
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".
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!
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
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().....
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 ?
Hi, Is it possible to use this plugin with Angular? Thx