| | |
| | | name: '地形' |
| | | }) |
| | | |
| | | const layer = new that.DC.TilesetLayer('layer') |
| | | viewer.addLayer(layer) |
| | | const tileset = new that.DC.Tileset( |
| | | 'http://resource.dvgis.cn/data/3dtiles/ljz/tileset.json' |
| | | // const tilesetLayer = new that.DC.TilesetLayer('tilesetLayer') |
| | | // viewer.addLayer(tilesetLayer) |
| | | // const tileset = new that.DC.Tileset( |
| | | // 'http://resource.dvgis.cn/data/3dtiles/ljz/tileset.json' |
| | | // ) |
| | | // const style = new that.DC.TilesetStyle() |
| | | // style.color = { |
| | | // conditions: [ |
| | | // // eslint-disable-next-line no-template-curly-in-string |
| | | // ['${Height} >= 300', 'rgba(45, 0, 75, 0.5)'], |
| | | // // eslint-disable-next-line no-template-curly-in-string |
| | | // ['${Height} >= 200', 'rgb(102, 71, 151)'], |
| | | // // eslint-disable-next-line no-template-curly-in-string |
| | | // ['${Height} >= 100', 'rgb(170, 162, 204)'], |
| | | // // eslint-disable-next-line no-template-curly-in-string |
| | | // ['${Height} >= 50', 'rgb(224, 226, 238)'], |
| | | // // eslint-disable-next-line no-template-curly-in-string |
| | | // ['${Height} >= 25', 'rgb(252, 230, 200)'], |
| | | // // eslint-disable-next-line no-template-curly-in-string |
| | | // ['${Height} >= 10', 'rgb(248, 176, 87)'], |
| | | // // eslint-disable-next-line no-template-curly-in-string |
| | | // ['${Height} >= 5', 'rgb(198, 106, 11)'], |
| | | // // eslint-disable-next-line no-template-curly-in-string |
| | | // ['true', 'rgb(127, 59, 8)'] |
| | | // ] |
| | | // } |
| | | // tileset.setStyle(style) |
| | | // tilesetLayer.addOverlay(tileset) |
| | | // viewer.flyTo(tileset) |
| | | // tileset.on(that.DC.MouseEventType.CLICK, e => { |
| | | // // that.popupFlag = true |
| | | |
| | | // viewer.scene.globe.depthTestAgainstTerrain = false |
| | | |
| | | // // 定制化窗体 |
| | | // // eslint-disable-next-line no-unused-vars |
| | | // var popup = new that.DC.DivForms(that.viewer, { |
| | | // domId: 'divFormsDomBox', |
| | | // position: [ |
| | | // e.position |
| | | // ] |
| | | // }) |
| | | |
| | | // that.$store.commit('SET_PANORAMAPOPUP', false) |
| | | // that.$store.commit('SET_DETAILSPOPUP', true) |
| | | // }) |
| | | |
| | | const wallLayer = new that.DC.VectorLayer('wallLayer') |
| | | viewer.addLayer(wallLayer) |
| | | |
| | | var arr = [ |
| | | [115.87597219, 28.74628526, 100], |
| | | [115.87556558, 28.74415792, 100], |
| | | [115.87459782, 28.74197687, 100], |
| | | [115.87371834, 28.74219927, 100], |
| | | [115.87210924, 28.74182217, 100], |
| | | [115.86469971, 28.73630725, 100], |
| | | [115.86387107, 28.73620123, 100], |
| | | [115.86274498, 28.73616026, 100], |
| | | [115.86173699, 28.74241350, 100], |
| | | [115.86105468, 28.74643934, 100], |
| | | [115.86609240, 28.74642593, 100], |
| | | [115.87597219, 28.74628526, 100] |
| | | ] |
| | | |
| | | arr.forEach(item => { |
| | | item = item.join(',') |
| | | }) |
| | | |
| | | arr = arr.join(';') |
| | | |
| | | const wall = new that.DC.Wall( |
| | | arr |
| | | ) |
| | | const style = new that.DC.TilesetStyle() |
| | | style.color = { |
| | | conditions: [ |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 300', 'rgba(45, 0, 75, 0.5)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 200', 'rgb(102, 71, 151)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 100', 'rgb(170, 162, 204)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 50', 'rgb(224, 226, 238)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 25', 'rgb(252, 230, 200)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 10', 'rgb(248, 176, 87)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['${Height} >= 5', 'rgb(198, 106, 11)'], |
| | | // eslint-disable-next-line no-template-curly-in-string |
| | | ['true', 'rgb(127, 59, 8)'] |
| | | ] |
| | | } |
| | | wall.setStyle({ |
| | | material: new that.DC.WallTrailMaterialProperty({ |
| | | color: that.DC.Color.GREEN, |
| | | speed: 4 |
| | | }) |
| | | }) |
| | | wallLayer.addOverlay(wall) |
| | | |
| | | viewer.use(new that.DC.Measure()) |
| | | |
| | | tileset.setStyle(style) |
| | | layer.addOverlay(tileset) |
| | | viewer.flyTo(tileset) |
| | | |
| | | tileset.on(that.DC.MouseEventType.CLICK, e => { |
| | | // that.popupFlag = true |
| | | |
| | | viewer.scene.globe.depthTestAgainstTerrain = false |
| | | |
| | | // 定制化窗体 |
| | | // eslint-disable-next-line no-unused-vars |
| | | var popup = new that.DC.DivForms(that.viewer, { |
| | | domId: 'divFormsDomBox', |
| | | position: [ |
| | | e.position |
| | | ] |
| | | }) |
| | | |
| | | that.$store.commit('SET_PANORAMAPOPUP', false) |
| | | that.$store.commit('SET_DETAILSPOPUP', true) |
| | | }) |
| | | viewer.flyTo(wallLayer) |
| | | |
| | | // viewer.zoomToPosition( |
| | | // new DC.Position(105.565571, 31.984708, 15362816, 0, -90) |
| | | // new that.DC.Position(115.87186406, 28.74449337, 1200, 0, -90) |
| | | // ) |
| | | |
| | | viewer.compass.enable = true |