1.1.2 • Published 12 months ago

@geosdi/ngx-leaflet-timedimension-plugin v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

NgxLeafletTimedimensionPlugin

This library was generated with 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

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

}
1.1.2

12 months ago

1.1.0

2 years ago

1.0.7

2 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago