@geosdi/ngx-leaflet-timedimension-plugin 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -175,10 +175,10 @@ export class NgxLeafletTimedimensionPluginService {
175
175
  isLg() {
176
176
  return this.breakpointObserver.isMatched(["(min-width: 992px)"]);
177
177
  }
178
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, deps: [{ token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable }); }
179
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, providedIn: "root" }); }
178
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, deps: [{ token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable }); }
179
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, providedIn: "root" }); }
180
180
  }
181
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, decorators: [{
181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, decorators: [{
182
182
  type: Injectable,
183
183
  args: [{
184
184
  providedIn: "root",
@@ -174,10 +174,10 @@ class NgxLeafletTimedimensionPluginService {
174
174
  isLg() {
175
175
  return this.breakpointObserver.isMatched(["(min-width: 992px)"]);
176
176
  }
177
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, deps: [{ token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable }); }
178
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, providedIn: "root" }); }
177
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, deps: [{ token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Injectable }); }
178
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, providedIn: "root" }); }
179
179
  }
180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, decorators: [{
180
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImport: i0, type: NgxLeafletTimedimensionPluginService, decorators: [{
181
181
  type: Injectable,
182
182
  args: [{
183
183
  providedIn: "root",
@@ -1 +1 @@
1
- {"version":3,"file":"geosdi-ngx-leaflet-timedimension-plugin.mjs","sources":["../../../../projects/geosdi/leaflet/ngx-leaflet-timedimension-plugin/src/lib/ngx-leaflet-timedimension-plugin.service.ts","../../../../projects/geosdi/leaflet/ngx-leaflet-timedimension-plugin/src/index.ts","../../../../projects/geosdi/leaflet/ngx-leaflet-timedimension-plugin/src/geosdi-ngx-leaflet-timedimension-plugin.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\n//@ts-ignore\nimport * as L from \"leaflet\";\nimport { BreakpointObserver } from \"@angular/cdk/layout\";\n\n/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\n\n/**\n * @param title\n * @param pageSize\n * @param action\n */\nexport interface INgxLeafletTimedimensionPluginService {\n /**\n * @param map\n */\n withMap(map: any): INgxLeafletTimedimensionPluginService;\n\n /**\n * @param options\n */\n withPlayerOptions(options: any): INgxLeafletTimedimensionPluginService;\n\n /**\n * @param options\n */\n withTimeDimensionOptionsOptions(\n options: any,\n ): INgxLeafletTimedimensionPluginService;\n\n /**\n * @param position\n */\n withPosition(\n position: \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\",\n ): INgxLeafletTimedimensionPluginService;\n\n /**\n * @param minSpeed\n */\n withMinSpeed(minSpeed: number): INgxLeafletTimedimensionPluginService;\n\n /**\n * @param maxSpeed\n */\n withMaxSpeed(maxSpeed: number): INgxLeafletTimedimensionPluginService;\n\n /*\n */\n applyTimeDimensionPlugin(): void;\n\n /**\n * @param startTime\n * @param endTime\n */\n refreshAvailableTimes(startTime: Date, endTime: Date): void;\n\n /**\n */\n getCurrentTime(): number;\n\n /**\n */\n getLowerTimeLimit(): number;\n\n /**\n * @param time\n * @param range\n */\n refreshTimeDimensionAtLastTime(time: number, range: number): void;\n\n /**\n */\n getUpperTimeLimit(): number;\n\n /**\n * @param step\n */\n play(step: number): void;\n\n /**\n * @param looped\n */\n setPlayerToLoop(looped: boolean): void;\n\n /**\n * @param time\n */\n setCurrentTime(time: number): any;\n}\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class NgxLeafletTimedimensionPluginService\n implements INgxLeafletTimedimensionPluginService\n{\n private player: L.TimeDimension.Player;\n private _playEnabled = false;\n private playerOptions: any;\n private timeDimensionOptions: any;\n private timeDimensionControl: L.Control.TimeDimension;\n private timeDimension: L.TimeDimension;\n private map: any;\n private _period: string;\n private position: string = \"topleft\";\n private minSpeed: number = 1;\n private maxSpeed: number = 5;\n\n constructor(public breakpointObserver: BreakpointObserver) {}\n\n /**\n * @param range\n */\n withMap(map: any): INgxLeafletTimedimensionPluginService {\n this.map = map;\n return this;\n }\n\n withPlayerOptions(options: any): INgxLeafletTimedimensionPluginService {\n this.playerOptions = options;\n return this;\n }\n\n withPosition(\n position: \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\",\n ): INgxLeafletTimedimensionPluginService {\n this.position = position;\n return this;\n }\n\n /***\n * @param options\n */\n withTimeDimensionOptionsOptions(\n options: any,\n ): INgxLeafletTimedimensionPluginService {\n this.timeDimensionOptions = options;\n return this;\n }\n\n /**\n * @param maxSpeed\n */\n withMaxSpeed(maxSpeed: number): INgxLeafletTimedimensionPluginService {\n this.maxSpeed = maxSpeed;\n return this;\n }\n\n /**\n * @param minSpeed\n */\n withMinSpeed(minSpeed: number): INgxLeafletTimedimensionPluginService {\n this.minSpeed = minSpeed;\n return this;\n }\n\n /**\n *\n * @param startTime\n * @param endTime\n */\n public refreshAvailableTimes(startTime: Date, endTime: Date) {\n this.timeDimension.setAvailableTimes(\n L.TimeDimension.Util.explodeTimeRange(\n startTime,\n endTime,\n this._period,\n ),\n \"replace\",\n );\n }\n\n /**\n *\n */\n public getCurrentTime(): number {\n return this.timeDimension.getCurrentTime();\n }\n\n /**\n * @param time\n */\n public setCurrentTime(time: number): any {\n this.timeDimension.setCurrentTime(new Date(time));\n }\n\n /**\n *\n */\n public autoApdate(): boolean {\n return (\n this.getUpperTimeLimit() === null ||\n this.getUpperTimeLimit() === this.timeDimension.getCurrentTime()\n );\n }\n\n /**\n */\n public getLowerTimeLimit(): number {\n return this.timeDimension.getAvailableTimes()[0];\n }\n\n /**\n *\n */\n refreshTimeDimensionAtLastTime(time: number, range: number) {\n const endTime = new Date(time);\n const startTime = new Date(time - range);\n this.refreshAvailableTimes(startTime, endTime);\n }\n\n /**\n *\n */\n getUpperTimeLimit(): number {\n const length = this.timeDimension.getAvailableTimes().length;\n return this.timeDimension.getAvailableTimes()[length - 1];\n }\n\n /**\n *\n * @param time\n */\n setTransitionTime(time: number) {\n this.player.setTransitionTime(time);\n }\n\n /**\n *\n * @param step\n */\n play(step: number) {\n this.player.start(step);\n }\n\n /**\n * @param looped\n */\n setPlayerToLoop(looped: boolean): void {\n this.player.setLooped(looped);\n }\n\n /**\n *\n * @param value\n */\n set period(value: string) {\n this._period = value;\n }\n\n /**\n */\n applyTimeDimensionPlugin(): void {\n if (this.map) {\n this.timeDimension = new L.TimeDimension(this.timeDimensionOptions);\n this.player = new L.TimeDimension.Player(\n this.playerOptions,\n this.timeDimension,\n );\n this.timeDimensionControl = new L.Control.TimeDimension({\n player: this.player,\n loopButton: true,\n playReverseButton: true,\n timeSlider: this.isMd(),\n speedSlider: this.isLg(),\n position: this.position,\n minSpeed: this.minSpeed,\n maxSpeed: this.maxSpeed,\n timeZones: [\"Local\", \"UTC\"],\n });\n\n this.player.on(\"play\", (eo: any) => {\n this._playEnabled = true;\n });\n this.player.on(\"stop\", (eo: any) => {\n this._playEnabled = false;\n });\n this.timeDimension.on(\"timeload\", () => {\n this.onLoadTimeChaged();\n });\n this.timeDimension.on(\n \"availabletimeschanged\",\n (availableTimes: any) => {\n this.onAvailableTimeChangedChaged();\n },\n );\n this.map.timeDimension = this.timeDimension;\n this.map.addControl(this.timeDimensionControl);\n }\n }\n\n /**\n *\n */\n protected onLoadTimeChaged(): void {}\n\n /**\n *\n */\n protected onAvailableTimeChangedChaged(): void {}\n\n /**\n *\n */\n private isMd(): boolean {\n return this.breakpointObserver.isMatched([\"(min-width: 768px)\"]);\n }\n\n /**\n *\n */\n private isLg(): boolean {\n return this.breakpointObserver.isMatched([\"(min-width: 992px)\"]);\n }\n}\n","/*\n * Public API Surface of ngx-leaflet-timedimension-plugin\n */\n\nexport * from \"./lib/ngx-leaflet-timedimension-plugin.service\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAiGa,oCAAoC,CAAA;AAe7C,IAAA,WAAA,CAAmB,kBAAsC,EAAA;QAAtC,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB,CAAoB;QAXjD,IAAY,CAAA,YAAA,GAAG,KAAK,CAAC;QAOrB,IAAQ,CAAA,QAAA,GAAW,SAA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-leaflet-timedimension-plugin.mjs","sources":["../../../../projects/geosdi/leaflet/ngx-leaflet-timedimension-plugin/src/lib/ngx-leaflet-timedimension-plugin.service.ts","../../../../projects/geosdi/leaflet/ngx-leaflet-timedimension-plugin/src/index.ts","../../../../projects/geosdi/leaflet/ngx-leaflet-timedimension-plugin/src/geosdi-ngx-leaflet-timedimension-plugin.ts"],"sourcesContent":["import { Injectable } from \"@angular/core\";\n//@ts-ignore\nimport * as L from \"leaflet\";\nimport { BreakpointObserver } from \"@angular/cdk/layout\";\n\n/**\n * @author Vito Salvia - CNR IMAA geoSDI Group\n * @email vito.salvia@gmail.com\n */\n\n/**\n * @param title\n * @param pageSize\n * @param action\n */\nexport interface INgxLeafletTimedimensionPluginService {\n /**\n * @param map\n */\n withMap(map: any): INgxLeafletTimedimensionPluginService;\n\n /**\n * @param options\n */\n withPlayerOptions(options: any): INgxLeafletTimedimensionPluginService;\n\n /**\n * @param options\n */\n withTimeDimensionOptionsOptions(\n options: any,\n ): INgxLeafletTimedimensionPluginService;\n\n /**\n * @param position\n */\n withPosition(\n position: \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\",\n ): INgxLeafletTimedimensionPluginService;\n\n /**\n * @param minSpeed\n */\n withMinSpeed(minSpeed: number): INgxLeafletTimedimensionPluginService;\n\n /**\n * @param maxSpeed\n */\n withMaxSpeed(maxSpeed: number): INgxLeafletTimedimensionPluginService;\n\n /*\n */\n applyTimeDimensionPlugin(): void;\n\n /**\n * @param startTime\n * @param endTime\n */\n refreshAvailableTimes(startTime: Date, endTime: Date): void;\n\n /**\n */\n getCurrentTime(): number;\n\n /**\n */\n getLowerTimeLimit(): number;\n\n /**\n * @param time\n * @param range\n */\n refreshTimeDimensionAtLastTime(time: number, range: number): void;\n\n /**\n */\n getUpperTimeLimit(): number;\n\n /**\n * @param step\n */\n play(step: number): void;\n\n /**\n * @param looped\n */\n setPlayerToLoop(looped: boolean): void;\n\n /**\n * @param time\n */\n setCurrentTime(time: number): any;\n}\n\n@Injectable({\n providedIn: \"root\",\n})\nexport class NgxLeafletTimedimensionPluginService\n implements INgxLeafletTimedimensionPluginService\n{\n private player: L.TimeDimension.Player;\n private _playEnabled = false;\n private playerOptions: any;\n private timeDimensionOptions: any;\n private timeDimensionControl: L.Control.TimeDimension;\n private timeDimension: L.TimeDimension;\n private map: any;\n private _period: string;\n private position: string = \"topleft\";\n private minSpeed: number = 1;\n private maxSpeed: number = 5;\n\n constructor(public breakpointObserver: BreakpointObserver) {}\n\n /**\n * @param range\n */\n withMap(map: any): INgxLeafletTimedimensionPluginService {\n this.map = map;\n return this;\n }\n\n withPlayerOptions(options: any): INgxLeafletTimedimensionPluginService {\n this.playerOptions = options;\n return this;\n }\n\n withPosition(\n position: \"topleft\" | \"topright\" | \"bottomleft\" | \"bottomright\",\n ): INgxLeafletTimedimensionPluginService {\n this.position = position;\n return this;\n }\n\n /***\n * @param options\n */\n withTimeDimensionOptionsOptions(\n options: any,\n ): INgxLeafletTimedimensionPluginService {\n this.timeDimensionOptions = options;\n return this;\n }\n\n /**\n * @param maxSpeed\n */\n withMaxSpeed(maxSpeed: number): INgxLeafletTimedimensionPluginService {\n this.maxSpeed = maxSpeed;\n return this;\n }\n\n /**\n * @param minSpeed\n */\n withMinSpeed(minSpeed: number): INgxLeafletTimedimensionPluginService {\n this.minSpeed = minSpeed;\n return this;\n }\n\n /**\n *\n * @param startTime\n * @param endTime\n */\n public refreshAvailableTimes(startTime: Date, endTime: Date) {\n this.timeDimension.setAvailableTimes(\n L.TimeDimension.Util.explodeTimeRange(\n startTime,\n endTime,\n this._period,\n ),\n \"replace\",\n );\n }\n\n /**\n *\n */\n public getCurrentTime(): number {\n return this.timeDimension.getCurrentTime();\n }\n\n /**\n * @param time\n */\n public setCurrentTime(time: number): any {\n this.timeDimension.setCurrentTime(new Date(time));\n }\n\n /**\n *\n */\n public autoApdate(): boolean {\n return (\n this.getUpperTimeLimit() === null ||\n this.getUpperTimeLimit() === this.timeDimension.getCurrentTime()\n );\n }\n\n /**\n */\n public getLowerTimeLimit(): number {\n return this.timeDimension.getAvailableTimes()[0];\n }\n\n /**\n *\n */\n refreshTimeDimensionAtLastTime(time: number, range: number) {\n const endTime = new Date(time);\n const startTime = new Date(time - range);\n this.refreshAvailableTimes(startTime, endTime);\n }\n\n /**\n *\n */\n getUpperTimeLimit(): number {\n const length = this.timeDimension.getAvailableTimes().length;\n return this.timeDimension.getAvailableTimes()[length - 1];\n }\n\n /**\n *\n * @param time\n */\n setTransitionTime(time: number) {\n this.player.setTransitionTime(time);\n }\n\n /**\n *\n * @param step\n */\n play(step: number) {\n this.player.start(step);\n }\n\n /**\n * @param looped\n */\n setPlayerToLoop(looped: boolean): void {\n this.player.setLooped(looped);\n }\n\n /**\n *\n * @param value\n */\n set period(value: string) {\n this._period = value;\n }\n\n /**\n */\n applyTimeDimensionPlugin(): void {\n if (this.map) {\n this.timeDimension = new L.TimeDimension(this.timeDimensionOptions);\n this.player = new L.TimeDimension.Player(\n this.playerOptions,\n this.timeDimension,\n );\n this.timeDimensionControl = new L.Control.TimeDimension({\n player: this.player,\n loopButton: true,\n playReverseButton: true,\n timeSlider: this.isMd(),\n speedSlider: this.isLg(),\n position: this.position,\n minSpeed: this.minSpeed,\n maxSpeed: this.maxSpeed,\n timeZones: [\"Local\", \"UTC\"],\n });\n\n this.player.on(\"play\", (eo: any) => {\n this._playEnabled = true;\n });\n this.player.on(\"stop\", (eo: any) => {\n this._playEnabled = false;\n });\n this.timeDimension.on(\"timeload\", () => {\n this.onLoadTimeChaged();\n });\n this.timeDimension.on(\n \"availabletimeschanged\",\n (availableTimes: any) => {\n this.onAvailableTimeChangedChaged();\n },\n );\n this.map.timeDimension = this.timeDimension;\n this.map.addControl(this.timeDimensionControl);\n }\n }\n\n /**\n *\n */\n protected onLoadTimeChaged(): void {}\n\n /**\n *\n */\n protected onAvailableTimeChangedChaged(): void {}\n\n /**\n *\n */\n private isMd(): boolean {\n return this.breakpointObserver.isMatched([\"(min-width: 768px)\"]);\n }\n\n /**\n *\n */\n private isLg(): boolean {\n return this.breakpointObserver.isMatched([\"(min-width: 992px)\"]);\n }\n}\n","/*\n * Public API Surface of ngx-leaflet-timedimension-plugin\n */\n\nexport * from \"./lib/ngx-leaflet-timedimension-plugin.service\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAiGa,oCAAoC,CAAA;AAe7C,IAAA,WAAA,CAAmB,kBAAsC,EAAA;QAAtC,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB;QAX7B,IAAY,CAAA,YAAA,GAAG,KAAK;QAOpB,IAAQ,CAAA,QAAA,GAAW,SAAS;QAC5B,IAAQ,CAAA,QAAA,GAAW,CAAC;QACpB,IAAQ,CAAA,QAAA,GAAW,CAAC;;AAI5B;;AAEG;AACH,IAAA,OAAO,CAAC,GAAQ,EAAA;AACZ,QAAA,IAAI,CAAC,GAAG,GAAG,GAAG;AACd,QAAA,OAAO,IAAI;;AAGf,IAAA,iBAAiB,CAAC,OAAY,EAAA;AAC1B,QAAA,IAAI,CAAC,aAAa,GAAG,OAAO;AAC5B,QAAA,OAAO,IAAI;;AAGf,IAAA,YAAY,CACR,QAA+D,EAAA;AAE/D,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,OAAO,IAAI;;AAGf;;AAEG;AACH,IAAA,+BAA+B,CAC3B,OAAY,EAAA;AAEZ,QAAA,IAAI,CAAC,oBAAoB,GAAG,OAAO;AACnC,QAAA,OAAO,IAAI;;AAGf;;AAEG;AACH,IAAA,YAAY,CAAC,QAAgB,EAAA;AACzB,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,OAAO,IAAI;;AAGf;;AAEG;AACH,IAAA,YAAY,CAAC,QAAgB,EAAA;AACzB,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;AACxB,QAAA,OAAO,IAAI;;AAGf;;;;AAIG;IACI,qBAAqB,CAAC,SAAe,EAAE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;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geosdi/ngx-leaflet-timedimension-plugin",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Service to add timedimension to map",
5
5
  "author": "Salvia Vito (vito.salvia@gmail.com)",
6
6
  "keywords": [
@@ -16,8 +16,8 @@
16
16
  "tslib": "^2.3.0"
17
17
  },
18
18
  "peerDependencies": {
19
- "@angular/common": ">=18.0.0",
20
- "@angular/core": ">=18.0.0",
19
+ "@angular/common": ">=19.0.0",
20
+ "@angular/core": ">=19.0.0",
21
21
  "leaflet": ">=1.9.3",
22
22
  "typescript": ">=5.0.0",
23
23
  "leaflet-timedimension": ">=1.1.1"