@naivemap/maplibre-gl-image-layer 0.0.1-alpha.2 → 0.0.1-alpha.4
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 +1 -1
- package/dist/ImageLayer.d.ts +10 -36
- package/dist/arrugator/index.d.ts +1 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2727 -2651
- package/dist/index.umd.cjs +10 -10
- package/dist/mask/index.d.ts +36 -0
- package/package.json +4 -3
package/README.md
CHANGED
package/dist/ImageLayer.d.ts
CHANGED
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
import { default as maplibregl } from 'maplibre-gl';
|
|
2
|
-
import {
|
|
3
|
-
/**
|
|
4
|
-
* The properties for masking the image layer.
|
|
5
|
-
*/
|
|
6
|
-
export type MaskProperty = {
|
|
7
|
-
/**
|
|
8
|
-
* The type of mask to apply.
|
|
9
|
-
* - 'in': The mask is applied inside the polygon (default).
|
|
10
|
-
* - 'out': The mask is applied outside the polygon.
|
|
11
|
-
*/
|
|
12
|
-
type?: 'in' | 'out';
|
|
13
|
-
/**
|
|
14
|
-
* The data for the mask, which can be a GeoJSON Polygon or MultiPolygon.
|
|
15
|
-
* If not provided, no mask will be applied.
|
|
16
|
-
*/
|
|
17
|
-
data: GeoJSON.Polygon | GeoJSON.MultiPolygon;
|
|
18
|
-
};
|
|
2
|
+
import { MaskProperty } from './mask';
|
|
19
3
|
/**
|
|
20
4
|
* The options for the ImageLayer.
|
|
21
5
|
*/
|
|
22
|
-
export type
|
|
6
|
+
export type ImageLayerOption = {
|
|
23
7
|
/**
|
|
24
8
|
* URL that points to an image.
|
|
25
9
|
*/
|
|
@@ -31,7 +15,7 @@ export type ImageOption = {
|
|
|
31
15
|
/**
|
|
32
16
|
* Corners of image specified in longitude, latitude pairs.
|
|
33
17
|
*/
|
|
34
|
-
coordinates: Coordinates;
|
|
18
|
+
coordinates: maplibregl.Coordinates;
|
|
35
19
|
/**
|
|
36
20
|
* The resampling/interpolation method to use for overscaling.
|
|
37
21
|
* - 'linear': Linear interpolation (default).
|
|
@@ -117,7 +101,7 @@ export default class ImageLayer implements maplibregl.CustomLayerInterface {
|
|
|
117
101
|
* @param id - A unique layer id
|
|
118
102
|
* @param option - ImageLayer options
|
|
119
103
|
*/
|
|
120
|
-
constructor(id: string, option:
|
|
104
|
+
constructor(id: string, option: ImageLayerOption);
|
|
121
105
|
/**
|
|
122
106
|
* @ignore
|
|
123
107
|
*/
|
|
@@ -133,22 +117,12 @@ export default class ImageLayer implements maplibregl.CustomLayerInterface {
|
|
|
133
117
|
/**
|
|
134
118
|
* Updates the URL, the projection, the coordinates, the opacity or the resampling of the image.
|
|
135
119
|
* @param {Object} option Options object.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
*
|
|
140
|
-
* @param
|
|
141
|
-
|
|
142
|
-
updateImage(option: {
|
|
143
|
-
url?: string;
|
|
144
|
-
projection?: string;
|
|
145
|
-
coordinates?: Coordinates;
|
|
146
|
-
opacity?: number;
|
|
147
|
-
resampling?: 'linear' | 'nearest';
|
|
148
|
-
}): this;
|
|
149
|
-
/**
|
|
150
|
-
* Updates the mask property
|
|
151
|
-
* @param {MaskProperty} mask The mask property.
|
|
120
|
+
*/
|
|
121
|
+
updateImage(option: Partial<Omit<ImageLayerOption, 'mask'>>): this;
|
|
122
|
+
/**
|
|
123
|
+
* Updates the mask property of the image layer.
|
|
124
|
+
* @param mask
|
|
125
|
+
* @returns
|
|
152
126
|
*/
|
|
153
127
|
updateMask(mask: Partial<MaskProperty>): this;
|
|
154
128
|
private loadTexture;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export type Coordinates = [[number, number], [number, number], [number, number], [number, number]];
|
|
2
1
|
export type ArrugadoFlat = {
|
|
3
2
|
pos: number[];
|
|
4
3
|
uv: number[];
|
|
5
4
|
trigs: number[];
|
|
6
5
|
};
|
|
7
|
-
export declare function initArrugator(fromProj: string, coordinates: Coordinates, step?: number): ArrugadoFlat;
|
|
6
|
+
export declare function initArrugator(fromProj: string, coordinates: maplibregl.Coordinates, step?: number): ArrugadoFlat;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as ImageLayer } from './ImageLayer';
|
|
2
|
-
export type {
|
|
2
|
+
export type { ImageLayerOption } from './ImageLayer';
|
|
3
3
|
export default ImageLayer;
|
|
4
|
-
export type {
|
|
4
|
+
export type { MaskProperty } from './mask';
|