Skip to content

Commit

Permalink
test(layer): update examples with max and min zoom properties Layer.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Jul 30, 2020
1 parent febc656 commit d427aac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions test/unit/dataSourceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ describe('Provide in Sources', function () {
featureLayer.update = FeatureProcessing.update;
featureLayer.projection = 'EPSG:4978';
featureLayer.mergeFeatures = false;
featureLayer.zoom.min = 10;
function extrude() {
return 5000;
}
Expand All @@ -86,7 +87,6 @@ describe('Provide in Sources', function () {
format: `${formatTag}application/json`,
extent: globalExtent,
projection: 'EPSG:3857',
zoom: { min: zoom, max: zoom },
});

featureLayer.convert = Feature2Mesh.convert({ color, extrude });
Expand Down Expand Up @@ -201,7 +201,7 @@ describe('Provide in Sources', function () {
});
});
it('should get 3 meshs with WFS source and DataSourceProvider', (done) => {
const tile = new TileMesh(geom, material, planarlayer, extent, zoom);
const tile = new TileMesh(geom, material, planarlayer, extent, featureLayer.zoom.min);
material.visible = true;
nodeLayer.level = EMPTY_TEXTURE_ZOOM;
tile.parent = { pendingSubdivision: false };
Expand All @@ -220,7 +220,7 @@ describe('Provide in Sources', function () {
material,
planarlayer,
extent,
zoom);
featureLayer.zoom.min);
tile.material.visible = true;
tile.parent = { pendingSubdivision: false };
featureLayer.source.uid = 8;
Expand Down
5 changes: 1 addition & 4 deletions test/unit/featureprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,17 @@ describe('Layer with Feature process', function () {
url: 'https://raw.githubusercontent.com/gregoiredavid/france-geojson/master/departements/09-ariege/departement-09-ariege.geojson',
projection: 'EPSG:4326',
format: 'application/json',
zoom: { min: 0, max: 0 },
networkOptions: process.env.HTTPS_PROXY ? { agent: new HttpsProxyAgent(process.env.HTTPS_PROXY) } : {},
});

const ariege = new GeometryLayer('ariege', new THREE.Group(), { source });
const ariege = new GeometryLayer('ariege', new THREE.Group(), { source, zoom: { min: 7 } });

ariege.update = FeatureProcessing.update;
ariege.convert = Feature2Mesh.convert({
color,
extrude,
});

ariege.source.zoom = 0;

const context = {
camera: viewer.camera,
engine: viewer.mainLoop.gfxEngine,
Expand Down
3 changes: 2 additions & 1 deletion test/unit/layeredmaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ describe('material state vs layer state', function () {
getLayer: () => nodeLayer,
visible: true,
},
getExtentsByProjection: () => 0,
getExtentsByProjection: () => ([{ zoom: 0 }]),
};
const layer = {
id: 'test',
visible: true,
opacity: 1.0,
zoom: { max: Infinity, min: 0 },
};

it('should correctly initialize opacity & visibility', () => {
Expand Down

0 comments on commit d427aac

Please sign in to comment.