ewoken / Leaflet.MovingMarker

A Leaflet plug-in to create moving marker
MIT License
342 stars 177 forks source link

Implement TypeScript file #38

Open vomnes opened 3 years ago

vomnes commented 3 years ago

Hello, I'm trying to implement the TypeScript of this plugin but I don't succeed. Someone already did it or have any good implementation idea ?

This is my implementation : The main problem is coming from the implementation of movingMarker.

import * as L from 'leaflet';

declare module 'leaflet' {
    interface MarkerOptions {
        autostart?: boolean;
        loop?: boolean;
    }

    interface Marker {
        movingMarker(latlngs: L.LatLng[], durations: Number[], options?: Object): Marker;
        addStation(pointIndex: number, duration: number): this;
        start(): this;
        isRunning(): this;
        isEnded(): this;
        isStarted(): this;
        isPaused(): this;
        resume(): this;
    }
}