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

Support for Angular? #6

Open
Stan92 opened this issue Jun 17, 2019 · 9 comments
Open

Support for Angular? #6

Stan92 opened this issue Jun 17, 2019 · 9 comments
Labels
good first issue Good for newcomers

Comments

@Stan92
Copy link

Stan92 commented Jun 17, 2019

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

@Igor-Vladyka
Copy link
Owner

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

@petterw03
Copy link

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

@Stan92
Copy link
Author

Stan92 commented Jun 25, 2019

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
Copy link
Owner

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

@minhproc1
Copy link

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
Copy link

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!

@Igor-Vladyka Igor-Vladyka added the good first issue Good for newcomers label Feb 16, 2022
@KondakovAl
Copy link

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
Copy link

arnovr commented Jun 20, 2024

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
Copy link

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 ?

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

No branches or pull requests

8 participants