Skip to content

Commit

Permalink
feat(LayeredMaterial): migrate to TypeScript
Browse files Browse the repository at this point in the history
fix(tests): add new empty methods to mock Material
  • Loading branch information
HoloTheDrunk committed Dec 17, 2024
1 parent fc2d3ab commit e873b26
Show file tree
Hide file tree
Showing 10 changed files with 556 additions and 294 deletions.
2 changes: 1 addition & 1 deletion src/Converter/convertToTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import * as THREE from 'three';
import TileMesh from 'Core/TileMesh';
import LayeredMaterial from 'Renderer/LayeredMaterial';
import { LayeredMaterial } from 'Renderer/LayeredMaterial';
import { newTileGeometry } from 'Core/Prefab/TileBuilder';
import ReferLayerProperties from 'Layer/ReferencingLayerProperties';
import { geoidLayerIsVisible } from 'Layer/GeoidLayer';
Expand Down
4 changes: 2 additions & 2 deletions src/Layer/ColorLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ class ColorLayer extends RasterLayer {
setupRasterNode(node) {
const rasterColorNode = new RasterColorTile(node.material, this);

node.material.addLayer(rasterColorNode);
node.material.addColorLayer(rasterColorNode);
// set up ColorLayer ordering.
node.material.setSequence(this.parent.colorLayersOrder);
node.material.setColorLayerIds(this.parent.colorLayersOrder);

return rasterColorNode;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Layer/ElevationLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class ElevationLayer extends RasterLayer {
setupRasterNode(node) {
const rasterElevationNode = new RasterElevationTile(node.material, this);

node.material.addLayer(rasterElevationNode);
node.material.setSequenceElevation(this.id);
node.material.setElevationLayer(rasterElevationNode);
node.material.setElevationLayerId(this.id);
// bounding box initialisation
const updateBBox = () => node.setBBoxZ({
min: rasterElevationNode.min, max: rasterElevationNode.max, scale: this.scale,
Expand Down
2 changes: 1 addition & 1 deletion src/Layer/TiledGeometryLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ class TiledGeometryLayer extends GeometryLayer {
if (layerUpdateState[c.id] && layerUpdateState[c.id].inError()) {
continue;
}
nodeLayer = node.material.getLayer(c.id);
nodeLayer = node.material.getColorLayer(c.id);
if (c.source.extentInsideLimit(node.extent, zoom) && (!nodeLayer || nodeLayer.level < 0)) {
return false;
}
Expand Down
275 changes: 0 additions & 275 deletions src/Renderer/LayeredMaterial.js

This file was deleted.

Loading

0 comments on commit e873b26

Please sign in to comment.