1.1.0 • Published 1 year ago

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

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year 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.0

1 year ago

1.0.7

1 year ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago