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

How to use this plugin in typescript project? #59

Open
roddc opened this issue Jul 8, 2020 · 2 comments
Open

How to use this plugin in typescript project? #59

roddc opened this issue Jul 8, 2020 · 2 comments

Comments

@roddc
Copy link

roddc commented Jul 8, 2020

I am trying to use this plugin in my Angular project, I have below type definition for the plugin, but it is not working,
I got an error : L.Handler.MarkerDrag is not a constructor, and I don't find any definition for this class

 declare module "leaflet" {
   namespace Handler {
    export class MarkerSnap extends L.Handler {
     constructor(map: L.Map, marker: L.Marker | L.CircleMarker, options?: any);
     initialize(
     map: L.Map,
     marker: L.Marker | L.CircleMarker,
     options?: any
     ): void;

   watchMarker(marker: L.Marker | L.CircleMarker): void;
   unwatchMarker(marker: L.Marker | L.CircleMarker): void;
   addGuideLayer(layer: L.Layer): void;
   }
   export class MarkerDrag extends L.Handler {
     constructor(marker: L.Marker | L.CircleMarker);
   }
 }
}
@gutard
Copy link
Collaborator

gutard commented Jul 8, 2020

L.Handler.MarkerDrag comes from Leaflet.Draw

@roddc
Copy link
Author

roddc commented Jul 8, 2020

L.Handler.MarkerDrag comes from Leaflet.Draw

Well, I did find it in the leaflet.draw-src.js file, but I have no idea how to give a definition for it, I have leaflet-draw javascript and typescript installed

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

No branches or pull requests

2 participants