@gisatcz/deckgl-geolib 1.10.2-dev.5 → 1.10.2-dev.7

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.
@@ -46,6 +46,10 @@ type _TerrainLayerProps = {
46
46
  wireframe?: boolean;
47
47
  /** Material props for lighting effect. * */
48
48
  material?: Material;
49
+ /**
50
+ * TODO
51
+ */
52
+ terrainOptions: Object;
49
53
  /**
50
54
  * @deprecated Use `loadOptions.terrain.workerUrl` instead
51
55
  */
@@ -22,7 +22,7 @@ declare class CogTiles {
22
22
  getResolutionFromZoomLevel(tileSize: number, z: number): number;
23
23
  getZoomLevelFromResolution(tileSize: number, resolution: number): number;
24
24
  getLatLon(input: number[]): number[];
25
- getTile(x: number, y: number, z: number, bounds: Bounds): Promise<string>;
25
+ getTile(x: number, y: number, z: number, bounds: Bounds, meshMaxError: number): Promise<string>;
26
26
  getFormat(sampleFormat: number[] | number, bitsPerSample: number[] | number): any;
27
27
  getNoDataValue(tags: any): number;
28
28
  }
@@ -44,7 +44,7 @@ export default class GeoImage {
44
44
  height: number;
45
45
  rasters: any[];
46
46
  bounds: Bounds;
47
- }, options: GeoImageOptions): Promise<string | {
47
+ }, options: GeoImageOptions, meshMaxError: any): Promise<string | {
48
48
  loaderData: {
49
49
  header: {};
50
50
  };
@@ -73,7 +73,7 @@ export default class GeoImage {
73
73
  width: number;
74
74
  height: number;
75
75
  rasters: any[];
76
- }, options: GeoImageOptions): Promise<{
76
+ }, options: GeoImageOptions, meshMaxError: any): Promise<{
77
77
  loaderData: {
78
78
  header: {};
79
79
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisatcz/deckgl-geolib",
3
- "version": "1.10.2-dev.5",
3
+ "version": "1.10.2-dev.7",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -10,8 +10,8 @@
10
10
  "scripts": {
11
11
  "rollup": "rollup -c",
12
12
  "start": "yarn && yarn rollup",
13
- "lint": "eslint src/**/* -c ./.eslintrc.cjs",
14
- "lintFix": "eslint src/**/* -c ./.eslintrc.cjs --fix"
13
+ "lint": "eslint 'src/**/*.{js, ts,tsx}' -c ./.eslintrc.cjs",
14
+ "lintFix": "eslint 'src/**/*.{js, ts,tsx}' -c ./.eslintrc.cjs --fix"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@rollup/plugin-commonjs": "^25.0.1",
@@ -159,10 +159,15 @@ export type TerrainLayerProps = _TerrainLayerProps &
159
159
  /** Material props for lighting effect. * */
160
160
  material?: Material;
161
161
 
162
+ /**
163
+ * TODO
164
+ */
165
+ terrainOptions: Object
166
+
162
167
  /**
163
168
  * @deprecated Use `loadOptions.terrain.workerUrl` instead
164
169
  */
165
- workerUrl?: string;
170
+ workerUrl?: string;
166
171
  };
167
172
 
168
173
  // TODO remove elevationDecoder
@@ -230,8 +235,8 @@ export default class TerrainLayer<ExtraPropsT extends {} = {}> extends Composite
230
235
 
231
236
  if (!this.state.isTiled && shouldReload) {
232
237
  // When state.isTiled, elevationData cannot be an array
233
- const terrain = this.loadTerrain(props as TerrainLoadProps);
234
- this.setState({ terrain });
238
+ // const terrain = this.loadTerrain(props as TerrainLoadProps);
239
+ // this.setState({ terrain });
235
240
  }
236
241
 
237
242
  // TODO - remove in v9
@@ -266,7 +271,7 @@ export default class TerrainLayer<ExtraPropsT extends {} = {}> extends Composite
266
271
  const { fetch } = this.props;
267
272
 
268
273
  return fetch(elevationData, {
269
- propName: 'elevationData', layer: this, loadOptions, signal,
274
+ propName: 'elevationData', layer: this, loadOptions, signal, loaders: [],
270
275
  });
271
276
  }
272
277
 
@@ -300,6 +305,7 @@ export default class TerrainLayer<ExtraPropsT extends {} = {}> extends Composite
300
305
  tile.index.y,
301
306
  tile.index.z,
302
307
  bounds,
308
+ this.props.meshMaxError,
303
309
  );
304
310
 
305
311
  return Promise.all([terrain]);
@@ -143,7 +143,7 @@ class CogTiles {
143
143
  return cartographicPositionAdjusted;
144
144
  }
145
145
 
146
- async getTile(x: number, y: number, z: number, bounds:Bounds) {
146
+ async getTile(x: number, y: number, z: number, bounds:Bounds, meshMaxError: number) {
147
147
  const wantedMpp = this.getResolutionFromZoomLevel(this.tileSize, z);
148
148
  const img = this.cog.getImageByResolution(wantedMpp);
149
149
  // await img.loadGeoTiffTags(1)
@@ -248,7 +248,7 @@ img.tags.get(339).value as Array<number>,
248
248
  width: this.tileSize,
249
249
  height: this.tileSize,
250
250
  bounds,
251
- }, this.options);
251
+ }, this.options, meshMaxError);
252
252
 
253
253
  // console.log(decompressed.length)
254
254
 
@@ -107,6 +107,7 @@ export default class GeoImage {
107
107
  bounds: Bounds
108
108
  },
109
109
  options: GeoImageOptions,
110
+ meshMaxError,
110
111
  ) {
111
112
  const mergedOptions = { ...DefaultGeoImageOptions, ...options };
112
113
 
@@ -114,7 +115,7 @@ export default class GeoImage {
114
115
  case 'image':
115
116
  return this.getBitmap(input, mergedOptions);
116
117
  case 'terrain':
117
- return this.getHeightmap(input, mergedOptions);
118
+ return this.getHeightmap(input, mergedOptions, meshMaxError);
118
119
  default:
119
120
  return null;
120
121
  }
@@ -128,6 +129,7 @@ export default class GeoImage {
128
129
  height: number,
129
130
  rasters: any[] },
130
131
  options: GeoImageOptions,
132
+ meshMaxError,
131
133
  ) {
132
134
  let rasters = [];
133
135
  let width: number;
@@ -186,7 +188,7 @@ export default class GeoImage {
186
188
  let mesh;
187
189
  switch (tesselator) {
188
190
  case 'martini':
189
- mesh = getMartiniTileMesh(terrainSkirtHeight, width, terrain);
191
+ mesh = getMartiniTileMesh(meshMaxError, width, terrain);
190
192
 
191
193
  break;
192
194
  case 'delatin':
@@ -197,7 +199,7 @@ export default class GeoImage {
197
199
  if (width === height && !(height && (width - 1))) {
198
200
  // fixme get terrain to separate method
199
201
  // terrain = getTerrain(data, width, height, elevationDecoder, 'martini');
200
- mesh = getMartiniTileMesh(terrainSkirtHeight, width, terrain);
202
+ mesh = getMartiniTileMesh(meshMaxError, width, terrain);
201
203
  } else {
202
204
  // fixme get terrain to separate method
203
205
  // terrain = getTerrain(data, width, height, elevationDecoder, 'delatin');