forked from JointCloud/JCC-RIP
fix
This commit is contained in:
parent
3feccfac9a
commit
d9193bbb5e
|
@ -172,23 +172,22 @@ export default {
|
|||
// 遍历省份构建模型
|
||||
const map = new Three.Object3D()
|
||||
chinaJson.features.forEach(elem => {
|
||||
console.log(elem)
|
||||
// 新建一个省份容器:用来存放省份对应的模型和轮廓线
|
||||
const province = new Three.Object3D()
|
||||
const coordinates = elem.geometry.coordinates
|
||||
coordinates.forEach(polygon => {
|
||||
// multiPolygon.forEach(polygon => {
|
||||
const lineMaterial = new Three.LineBasicMaterial({ color: 0XF19553 }) // 0x3BFA9E
|
||||
const positions = []
|
||||
const linGeometry = new Three.BufferGeometry()
|
||||
for (let i = 0; i < polygon.length; i++) {
|
||||
var pos = this.getPosition(polygon[i][0], polygon[i][1])
|
||||
positions.push(pos.x, pos.y, pos.z)
|
||||
}
|
||||
linGeometry.setAttribute('position', new Three.Float32BufferAttribute(positions, 3))
|
||||
const line = new Three.Line(linGeometry, lineMaterial)
|
||||
province.add(line)
|
||||
// })
|
||||
coordinates.forEach(multiPolygon => {
|
||||
multiPolygon.forEach(polygon => {
|
||||
const lineMaterial = new Three.LineBasicMaterial({ color: 0XF19553 }) // 0x3BFA9E
|
||||
const positions = []
|
||||
const linGeometry = new Three.BufferGeometry()
|
||||
for (let i = 0; i < polygon.length; i++) {
|
||||
var pos = this.getPosition(polygon[i][0], polygon[i][1], 100)
|
||||
positions.push(pos.x, pos.y, pos.z)
|
||||
}
|
||||
linGeometry.setAttribute('position', new Three.Float32BufferAttribute(positions, 3))
|
||||
const line = new Three.Line(linGeometry, lineMaterial)
|
||||
province.add(line)
|
||||
})
|
||||
})
|
||||
map.add(province)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue