leaflet.motion
leaflet.motion copied to clipboard
Support for Angular?
Hi, Is it possible to use this plugin with Angular? Thx
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