@naivemap/maplibre-gl-image-layer 0.0.1-alpha.2 → 0.0.1-alpha.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.
package/README.md CHANGED
@@ -7,5 +7,5 @@ ImageLayer ([@naivemap/maplibre-gl-image-layer](https://www.npmjs.com/package/@n
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- pnpm add @naivemap/maplibre-gl-image-layer
10
+ pnpm add @naivemap/maplibre-gl-image-layer proj4
11
11
  ```
@@ -1,25 +1,9 @@
1
1
  import { default as maplibregl } from 'maplibre-gl';
2
- import { Coordinates } from './arrugator';
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 ImageOption = {
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: ImageOption);
104
+ constructor(id: string, option: ImageLayerOption);
121
105
  /**
122
106
  * @ignore
123
107
  */
@@ -133,24 +117,8 @@ 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
- * @param {string} [option.url] Image URL.
137
- * @param {string} [option.projection] Projection with EPSG code that points to the image..
138
- * @param {Array<Array<number>>} [option.coordinates] Four geographical coordinates,
139
- * @param {number} [option.opacity] opacity of the image.
140
- * @param {string} [option.resampling] The resampling/interpolation method to use for overscaling.
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.
152
120
  */
153
- updateMask(mask: Partial<MaskProperty>): this;
121
+ updateImage(option: Partial<ImageLayerOption>): void;
154
122
  private loadTexture;
155
123
  private getMaskBufferInfo;
156
124
  }
@@ -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 { ImageOption, MaskProperty } from './ImageLayer';
2
+ export type { ImageLayerOption as ImageOption } from './ImageLayer';
3
3
  export default ImageLayer;
4
- export type { Coordinates } from './arrugator';
4
+ export type { MaskProperty } from './mask';