style: lint style

This commit is contained in:
shihui 2021-10-25 20:29:14 +08:00
parent d0c8f6ae59
commit 6bbc9dc5b2
3 changed files with 13 additions and 13 deletions

View File

@ -29,7 +29,7 @@ scene.on('loaded', () => {
const center = scene.getCenter();
const cubeGeometry = new THREE.BoxBufferGeometry(10000, 10000, 10000);
const cubeMaterial = new THREE.MeshNormalMaterial({side: THREE.DoubleSide});
const cubeMaterial = new THREE.MeshNormalMaterial({ side: THREE.DoubleSide });
const cube = new THREE.Mesh(cubeGeometry, cubeMaterial);
layer.setObjectLngLat(cube, [ center.lng + 0.05, center.lat ], 0);
threeScene.add(cube);
@ -42,7 +42,7 @@ scene.on('loaded', () => {
// 根据 GeoJSON 数据放置模型
layer.getSource().data.dataArray.forEach(({ coordinates }) => {
const gltfScene = gltf.scene;
setDouble(gltfScene)
setDouble(gltfScene);
layer.adjustMeshToMap(gltfScene);
// gltfScene.scale.set(1000, 1000, 1000)
layer.setMeshScale(gltfScene, 1000, 1000, 1000);
@ -102,9 +102,9 @@ scene.on('loaded', () => {
});
function setDouble(object) {
if(object.children && object.children.length && object.children.length > 0) {
object.children.map(child => setDouble(child))
} else if(object.material){
if (object.children && object.children.length && object.children.length > 0) {
object.children.map(child => setDouble(child));
} else if (object.material) {
object.material.side = THREE.DoubleSide;
}
}

View File

@ -162,7 +162,7 @@ scene.on('loaded', () => {
gltf => {
// 根据 GeoJSON 数据放置模型
const gltfScene = gltf.scene.clone();
setDouble(gltfScene)
setDouble(gltfScene);
layer.getSource().data.dataArray.forEach(() => {
layer.adjustMeshToMap(gltfScene);
gltfScene.scale.set(500000, 500000, 500000);
@ -218,9 +218,9 @@ scene.on('loaded', () => {
});
function setDouble(object) {
if(object.children && object.children.length && object.children.length > 0) {
object.children.map(child => setDouble(child))
} else if(object.material){
if (object.children && object.children.length && object.children.length > 0) {
object.children.map(child => setDouble(child));
} else if (object.material) {
object.material.side = THREE.DoubleSide;
}
}

View File

@ -157,7 +157,7 @@ scene.on('loaded', () => {
'https://gw.alipayobjects.com/os/bmw-prod/3ca0a546-92d8-4ba0-a89c-017c218d5bea.gltf',
gltf => {
const antModel = gltf.scene;
setDouble(antModel)
setDouble(antModel);
// antModel.children[0].material.side = THREE.DoubleSide
layer.adjustMeshToMap(antModel);
layer.setMeshScale(antModel, 20, 20, 20);
@ -428,9 +428,9 @@ scene.on('loaded', () => {
});
function setDouble(object) {
if(object.children && object.children.length && object.children.length > 0) {
object.children.map(child => setDouble(child))
} else if(object.material){
if (object.children && object.children.length && object.children.length > 0) {
object.children.map(child => setDouble(child));
} else if (object.material) {
object.material.side = THREE.DoubleSide;
}
}