leaflet.motion icon indicating copy to clipboard operation
leaflet.motion copied to clipboard

Support for Angular?

Open Stan92 opened this issue 5 years ago • 9 comments

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

Stan92 avatar Jun 17 '19 19:06 Stan92

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

Igor-Vladyka avatar Jun 24 '19 12:06 Igor-Vladyka

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

petterw03 avatar Jun 25 '19 12:06 petterw03

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 avatar Jun 25 '19 13:06 Stan92

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

Igor-Vladyka avatar Apr 14 '20 01:04 Igor-Vladyka

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".

minhproc1 avatar Aug 27 '20 13:08 minhproc1

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!

dishubagga avatar Nov 02 '20 10:11 dishubagga

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

KondakovAl avatar Jan 05 '23 22:01 KondakovAl