Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
ng-smart3d
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张启明
ng-smart3d
Commits
9daec95b
Commit
9daec95b
authored
Feb 13, 2020
by
张启明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: 完善 flyManager
parent
61911759
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
11 deletions
+33
-11
fly-manager.component.ts
src/app/components/fly-manager/fly-manager.component.ts
+25
-9
pick.component.ts
src/app/components/pick/pick.component.ts
+6
-0
tileset-editor.component.ts
...app/components/tileset-editor/tileset-editor.component.ts
+2
-2
No files found.
src/app/components/fly-manager/fly-manager.component.ts
View file @
9daec95b
...
...
@@ -10,7 +10,8 @@ export class FlyManagerComponent implements OnInit {
private
viewer
;
private
flyManager
;
private
flyMnaagerOptions
;
private
flyManagerOptions
;
private
handler
;
constructor
(
private
viewerService
:
ViewerService
,
...
...
@@ -19,26 +20,41 @@ export class FlyManagerComponent implements OnInit {
ngOnInit
()
{
this
.
viewer
=
this
.
viewerService
.
viewer
;
this
.
flyM
na
agerOptions
=
{
perspective
:
smart3d
.
FlyPerspective
.
THIRD
,
duration
:
100
,
this
.
flyM
an
agerOptions
=
{
perspective
:
smart3d
.
FlyPerspective
.
FIRST
,
duration
:
3
,
infinite
:
false
,
// camera: { followX: 2
00, followZ: 100 }, // FlyPerspective.FIRST
camera
:
{
followX
:
1
00
,
followZ
:
100
},
// FlyPerspective.FIRST
path
:
{
width
:
4
,
material
:
new
Cesium
.
PolylineGlowMaterialProperty
({
color
:
Cesium
.
Color
.
RED
})
},
point
:
{
pixelSize
:
0
},
model
:
{
uri
:
'assets/models/boat.gltf'
},
// label
// site
};
this
.
flyManager
=
new
smart3d
.
FlyManager
(
this
.
viewer
,
this
.
flyMnaagerOptions
);
this
.
flyManager
=
new
smart3d
.
FlyManager
(
this
.
viewer
,
this
.
flyManagerOptions
);
this
.
flyManager
.
stopArrived
.
addEventListener
(()
=>
{
this
.
flyManager
.
clear
();
});
this
.
handler
=
new
smart3d
.
DrawHandler
(
this
.
viewer
,
smart3d
.
DrawMode
.
Line
);
this
.
handler
.
drewEvent
.
addEventListener
(
cartesians
=>
{
const
updatedCartesians
=
cartesians
.
map
(
cartesian
=>
{
const
cartographic
=
Cesium
.
Cartographic
.
fromCartesian
(
cartesian
);
return
Cesium
.
Cartesian3
.
fromRadians
(
cartographic
.
longitude
,
cartographic
.
latitude
,
cartographic
.
height
+
1000
);
});
this
.
flyManager
.
addRouteFromPositions
(
updatedCartesians
,
this
.
flyManagerOptions
);
this
.
handler
.
clear
();
});
}
handleDrawPath
(
options
:
{
clampToGround
?:
boolean
})
{
this
.
flyManager
.
drawNewRoute
({
isGround
:
undefined
!==
options
.
clampToGround
?
options
.
clampToGround
:
true
,
});
this
.
handler
.
activate
();
// this.flyManager.drawNewRoute({
// isGround: undefined !== options.clampToGround ? options.clampToGround : true,
// });
}
startFly
()
{
...
...
src/app/components/pick/pick.component.ts
View file @
9daec95b
...
...
@@ -29,6 +29,12 @@ export class PickComponent implements OnInit {
const
degreesCartographic
=
this
.
viewerService
.
cartesianToDegreesCartographic
(
cartesian
);
alert
(
'拾取到的坐标:('
+
degreesCartographic
.
longitude
+
', '
+
degreesCartographic
.
latitude
+
', '
+
degreesCartographic
.
height
+
')'
);
});
// const tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
// url: 'http://www.south-smart.com/w3d-data/modeldata/nanfangcehuiBIM/NFCH0911/CHDLFC/tileset.json'
// }));
// const pick = new smart3d.Pick(viewer, smart3d.PickMode[type.toUpperCase()]);
// pick.start();
// viewer.flyTo(tileset);
}
clearPick
()
{
...
...
src/app/components/tileset-editor/tileset-editor.component.ts
View file @
9daec95b
...
...
@@ -41,12 +41,12 @@ export class TilesetEditorComponent implements OnInit {
if
(
undefined
!==
this
.
tilesetEdit
)
{
this
.
tilesetEdit
.
save
();
// 测试缩放、旋转、平移
//
取消下面任一行注释,
测试缩放、旋转、平移
// this.tilesetEdit.scale(2);
// this.tilesetEdit.rotation(smart3d.EditAxisMode.Z, 45);
// this.tilesetEdit.translation(smart3d.EditAxisMode.Y, 30);
// 测试设置 3D tiles 的 modelMatrix
//
取消下面一行注释,
测试设置 3D tiles 的 modelMatrix
// this.tilesetEdit.pasteMatrix(Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0, 0, 100)));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment