open-index/open-npm huggingface dataset:
npm package: @geosdi/ngx-leaflet-timedimension-plugin
Description: Service to add timedimension to map
Author: Salvia Vito
Latest version: 1.1.5

# NgxLeafletTimedimensionPlugin

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.0.0.

# General information

Service to wrap leaflet timedimensione see documentation to https://github.com/socib/Leaflet.TimeDimension

## Installation

`npm i @geosdi/ngx-leaflet-timedimension-plugin --save`

It depends on :

    "@angular/common": ">=13.0.0",
    "@angular/core": ">=13.0.0",
    "leaflet": ">=1.7.1",
    "leaflet-timedimension": "^1.1.1"

## Usage

 ```typescript

import { Injectable } from '@angular/core'; 
import {TimeDimensionExtensionService} from "./time-dimension-extension-service"; 

@Injectable({
  providedIn: 'root'
})
export class Service {


    constructor(private ngxLeafletTimedimensionPluginService: TimeDimensionExtensionService) {
    }

   public addPlugin() {
    //4/11/2021
     const endTime = new Date(1636022400000);
    //28/10/2021
     const startTime = new Date(1636022400000 - 604800000);
    this.ngxLeafletTimedimensionPluginService
      .withTimeDimensionOptionsOptions({
        times: L.TimeDimension.Util.explodeTimeRange(startTime, endTime, "PT5M"),
        period: "P5M",
      })
      .withMap(this.map).withPlayerOptions({loop: true, transitionTime: 333}).applyTimeDimensionPlugin();
    this.ngxLeafletTimedimensionPluginService.setPlayerToLoop(true);
    wmsLayer.addTo(this.map);
    setTimeout(() => {
      this.ngxLeafletTimedimensionPluginService.setPlayerToLoop(false);
    }, 2000);
    }

}

 ```