fix eslint warning in globe.js
This commit is contained in:
parent
7938e00684
commit
9d2bebfd13
12
src/globe.js
12
src/globe.js
|
@ -8,7 +8,6 @@ function checkMaterial(object) {
|
||||||
if (object.material) {
|
if (object.material) {
|
||||||
const materialName = object.material.name;
|
const materialName = object.material.name;
|
||||||
if (materialName === 'canvas') {
|
if (materialName === 'canvas') {
|
||||||
console.log('Found material for canvas texture');
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +21,7 @@ function parseHashCoords() {
|
||||||
const ident = array.shift();
|
const ident = array.shift();
|
||||||
const [id, size, x, y] = array.map(z => parseInt(z, 10));
|
const [id, size, x, y] = array.map(z => parseInt(z, 10));
|
||||||
if (!ident || isNaN(x) || isNaN(y) || isNaN(id) || isNaN(size)) {
|
if (!ident || isNaN(x) || isNaN(y) || isNaN(id) || isNaN(size)) {
|
||||||
throw 'NaN';
|
throw new Error('NaN');
|
||||||
}
|
}
|
||||||
return [ident, id, size, x, y];
|
return [ident, id, size, x, y];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -31,7 +30,6 @@ function parseHashCoords() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function rotateToCoords(canvasSize, object, coords) {
|
function rotateToCoords(canvasSize, object, coords) {
|
||||||
console.log('Rotate to', coords);
|
|
||||||
const [x, y] = coords;
|
const [x, y] = coords;
|
||||||
const rotOffsetX = 0;
|
const rotOffsetX = 0;
|
||||||
const rotOffsetY = 3 * Math.PI / 2;
|
const rotOffsetY = 3 * Math.PI / 2;
|
||||||
|
@ -116,10 +114,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
rotateToCoords(canvasSize, object, [x, y]);
|
rotateToCoords(canvasSize, object, [x, y]);
|
||||||
controls = createControls();
|
controls = createControls();
|
||||||
render();
|
render();
|
||||||
}, (xhr) => {
|
}, () => {
|
||||||
console.log(`${xhr.loaded} loaded`);
|
// console.log(`${xhr.loaded} loaded`);
|
||||||
}, (error) => {
|
}, () => {
|
||||||
console.log('An error happened', error);
|
// console.log('An error happened', error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user