Skip to content

How to use this plugin in typescript project? #59

@roddc

Description

@roddc

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);
   }
 }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions