maplibre-gl-nightlayer 1.0.0-alpha.3 → 1.0.0-alpha.5
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.
- package/README.md +5 -5
- package/dist/main.d.ts +48 -32
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -45,19 +45,19 @@ class NightLayer implements CustomLayerInterface {
|
|
|
45
45
|
setDate(date: Date | null): void;
|
|
46
46
|
|
|
47
47
|
getOpacity(): number;
|
|
48
|
-
setOpacity(
|
|
48
|
+
setOpacity(opacity: number): void;
|
|
49
49
|
|
|
50
50
|
getColor(): Color;
|
|
51
|
-
setColor(
|
|
51
|
+
setColor(color: Color): void;
|
|
52
52
|
|
|
53
53
|
getTwilightSteps(): number;
|
|
54
|
-
setTwilightSteps(
|
|
54
|
+
setTwilightSteps(steps: number): void;
|
|
55
55
|
|
|
56
56
|
getTwilightStepAngle(): number;
|
|
57
|
-
setTwilightStepAngle(
|
|
57
|
+
setTwilightStepAngle(angle: number): void;
|
|
58
58
|
|
|
59
59
|
getTwilightAttenuation(): number;
|
|
60
|
-
setTwilightAttenuation(
|
|
60
|
+
setTwilightAttenuation(attenuation: number): void;
|
|
61
61
|
|
|
62
62
|
:
|
|
63
63
|
}
|
package/dist/main.d.ts
CHANGED
|
@@ -3,20 +3,36 @@ import type { mat4 } from 'gl-matrix';
|
|
|
3
3
|
type Color = [number, number, number];
|
|
4
4
|
/**
|
|
5
5
|
* Options for the NightLayer.
|
|
6
|
-
*
|
|
7
|
-
* @property date Date. If null, the current date is used.
|
|
8
|
-
* @property opacity Opacity. 0.0 means fully transparent, 1.0 means fully opaque.
|
|
9
|
-
* @property color RGB color. Each value should be in the range [0, 255].
|
|
10
|
-
* @property twilightSteps Number of twilight steps. 0 means no steps (gradation), 1 means one step (day/night), etc.
|
|
11
|
-
* @property twilightStepAngle Angle in degrees for each twilight step.
|
|
12
|
-
* @property twilightAttenuation Attenuation factor for each twilight step. 0.0 means no attenuation, 1.0 means full attenuation.
|
|
13
6
|
*/
|
|
14
7
|
type Options = {
|
|
8
|
+
/**
|
|
9
|
+
* Date for the shadow.
|
|
10
|
+
* If null, the current date is used.
|
|
11
|
+
*/
|
|
15
12
|
date?: Date | null;
|
|
13
|
+
/**
|
|
14
|
+
* Opacity of the shadow.
|
|
15
|
+
* 0.0 means fully transparent, 1.0 means fully opaque
|
|
16
|
+
*/
|
|
16
17
|
opacity?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Color of the shadow.
|
|
20
|
+
* Each value should be in the range [0, 255].
|
|
21
|
+
*/
|
|
17
22
|
color?: Color;
|
|
23
|
+
/**
|
|
24
|
+
* Number of twilight steps.
|
|
25
|
+
* 0 means no steps (gradation), 1 means one step (day/night), etc.
|
|
26
|
+
*/
|
|
18
27
|
twilightSteps?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Angle for each twilight step in degrees.
|
|
30
|
+
*/
|
|
19
31
|
twilightStepAngle?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Attenuation factor for each twilight step.
|
|
34
|
+
* 0.0 means no attenuation, 1.0 means full attenuation
|
|
35
|
+
*/
|
|
20
36
|
twilightAttenuation?: number;
|
|
21
37
|
};
|
|
22
38
|
/**
|
|
@@ -29,77 +45,77 @@ export declare class NightLayer implements CustomLayerInterface {
|
|
|
29
45
|
renderingMode: "2d";
|
|
30
46
|
/**
|
|
31
47
|
* Create a new NightLayer instance. Intended to be passed to `map.addLayer`.
|
|
32
|
-
* @param opts
|
|
48
|
+
* @param opts The options.
|
|
33
49
|
*/
|
|
34
50
|
constructor(opts?: Options);
|
|
35
51
|
/**
|
|
36
52
|
* Get the subsolar point (longitude and latitude) at the given date.
|
|
37
|
-
* @param date
|
|
53
|
+
* @param date If null, the current date is used.
|
|
38
54
|
*/
|
|
39
55
|
getSubsolarPoint(date: Date): {
|
|
40
56
|
subsolarLng: number;
|
|
41
57
|
subsolarLat: number;
|
|
42
58
|
};
|
|
43
59
|
/**
|
|
44
|
-
* Get the date
|
|
45
|
-
* @returns
|
|
60
|
+
* Get the date for the shadow.
|
|
61
|
+
* @returns The date. If null, the current date is used.
|
|
46
62
|
*/
|
|
47
63
|
getDate(): Date | null;
|
|
48
64
|
/**
|
|
49
|
-
* Set the date
|
|
50
|
-
* @param date
|
|
65
|
+
* Set the date for the shadow.
|
|
66
|
+
* @param date If null, the current date is used.
|
|
51
67
|
*/
|
|
52
68
|
setDate(date: Date | null): void;
|
|
53
69
|
/**
|
|
54
|
-
* Get the opacity of the
|
|
55
|
-
* @returns
|
|
70
|
+
* Get the opacity of the shadow.
|
|
71
|
+
* @returns The opacity. 0.0 means fully transparent, 1.0 means fully opaque.
|
|
56
72
|
*/
|
|
57
73
|
getOpacity(): number;
|
|
58
74
|
/**
|
|
59
|
-
* Set the opacity of the
|
|
60
|
-
* @param
|
|
75
|
+
* Set the opacity of the shadow.
|
|
76
|
+
* @param opacity 0.0 means fully transparent, 1.0 means fully opaque.
|
|
61
77
|
*/
|
|
62
|
-
setOpacity(
|
|
78
|
+
setOpacity(opacity: number): void;
|
|
63
79
|
/**
|
|
64
|
-
* Get the color of the
|
|
65
|
-
* @returns
|
|
80
|
+
* Get the color of the shadow.
|
|
81
|
+
* @returns The color. Each value is in the range [0, 255].
|
|
66
82
|
*/
|
|
67
83
|
getColor(): Color;
|
|
68
84
|
/**
|
|
69
|
-
* Set the color of the
|
|
70
|
-
* @param
|
|
85
|
+
* Set the color of the shadow.
|
|
86
|
+
* @param color Each value should be in the range [0, 255].
|
|
71
87
|
*/
|
|
72
|
-
setColor(
|
|
88
|
+
setColor(color: Color): void;
|
|
73
89
|
/**
|
|
74
90
|
* Get the number of twilight steps.
|
|
75
|
-
* @returns 0 means no steps (gradation), 1 means one step (day/night), etc.
|
|
91
|
+
* @returns The steps. 0 means no steps (gradation), 1 means one step (day/night), etc.
|
|
76
92
|
*/
|
|
77
93
|
getTwilightSteps(): number;
|
|
78
94
|
/**
|
|
79
95
|
* Set the number of twilight steps.
|
|
80
|
-
* @param
|
|
96
|
+
* @param steps 0 means no steps (gradation), 1 means one step (day/night), etc.
|
|
81
97
|
*/
|
|
82
|
-
setTwilightSteps(
|
|
98
|
+
setTwilightSteps(steps: number): void;
|
|
83
99
|
/**
|
|
84
100
|
* Get the angle for each twilight step.
|
|
85
|
-
* @returns angle in degrees.
|
|
101
|
+
* @returns The angle in degrees.
|
|
86
102
|
*/
|
|
87
103
|
getTwilightStepAngle(): number;
|
|
88
104
|
/**
|
|
89
105
|
* Set the angle for each twilight step.
|
|
90
|
-
* @param
|
|
106
|
+
* @param angle in degrees.
|
|
91
107
|
*/
|
|
92
|
-
setTwilightStepAngle(
|
|
108
|
+
setTwilightStepAngle(angle: number): void;
|
|
93
109
|
/**
|
|
94
110
|
* Get the attenuation factor for each twilight step.
|
|
95
|
-
* @returns 0.0 means no attenuation, 1.0 means full attenuation.
|
|
111
|
+
* @returns The attenuation. 0.0 means no attenuation, 1.0 means full attenuation.
|
|
96
112
|
*/
|
|
97
113
|
getTwilightAttenuation(): number;
|
|
98
114
|
/**
|
|
99
115
|
* Set the attenuation factor for each twilight step.
|
|
100
|
-
* @param
|
|
116
|
+
* @param attenuation 0.0 means no attenuation, 1.0 means full attenuation.
|
|
101
117
|
*/
|
|
102
|
-
setTwilightAttenuation(
|
|
118
|
+
setTwilightAttenuation(attenuation: number): void;
|
|
103
119
|
onAdd(map: MaplibreMap, gl: WebGLRenderingContext): void;
|
|
104
120
|
onRemove(): void;
|
|
105
121
|
render(gl: WebGLRenderingContext, matrix: mat4): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maplibre-gl-nightlayer",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.5",
|
|
4
4
|
"description": "A Night Layer for MapLibre GL JS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"terminator"
|
|
29
29
|
],
|
|
30
30
|
"author": "kikuchan98@gmail.com",
|
|
31
|
+
"homepage": "https://github.com/kikuchan/maplibre-gl-nightlayer#readme",
|
|
31
32
|
"license": "MIT",
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@biomejs/biome": "^1.9.4",
|