Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
webgis
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oscar
webgis
Commits
26510553
Commit
26510553
authored
Apr 06, 2022
by
oscar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交测试修改
parent
580bd2a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
csv2json.js
csv2json.js
+1
-1
renderModel.js
public/js/renderModel.js
+18
-1
No files found.
csv2json.js
View file @
26510553
...
...
@@ -30,7 +30,7 @@ function csv2json(csvFile, parsetime) {
else
if
(
items
[
24
]
==
5
)
typeName
=
"Bicycle"
;
let
obj
=
{
ID
:
items
[
3
],
PtcType
:
typeName
,
time
:
parseInt
(
items
[
2
]),
PtcHeading
:
items
[
31
],
PtcLon
:
items
[
3
5
],
PtcLat
:
items
[
36
],
DataType
:
'3'
,
Dev
:
'1'
}
let
obj
=
{
ID
:
items
[
3
],
PtcType
:
typeName
,
time
:
parseInt
(
items
[
2
]),
PtcHeading
:
items
[
31
],
PtcLon
:
items
[
3
6
],
PtcLat
:
items
[
35
],
DataType
:
'3'
,
Dev
:
'1'
}
if
(
num
==
0
)
{
}
...
...
public/js/renderModel.js
View file @
26510553
...
...
@@ -59,7 +59,7 @@ function resolveData(data, scene) {
{
let
textObj
=
null
;
if
(
textFont
)
{
let
txt
=
data
[
i
].
ID
.
substr
(
data
[
i
].
ID
.
length
-
5
,
data
[
i
].
ID
.
length
)
+
'.'
+
data
[
i
].
Dev
.
substr
(
data
[
i
].
Dev
.
length
-
5
,
data
[
i
].
Dev
.
length
)
let
txt
=
data
[
i
].
ID
.
substr
(
data
[
i
].
ID
.
length
-
5
,
data
[
i
].
ID
.
length
)
+
"."
+
data
[
i
].
PtcHeading
.
substr
(
0
,
3
);
//data[i].ID.substr(data[i].ID.length - 5, data[i].ID
.length)
var
geometry
=
new
THREE
.
TextGeometry
(
txt
,
{
font
:
textFont
,
size
:
1
,
height
:
0.1
,
curveSegments
:
1
...
...
@@ -83,6 +83,23 @@ function resolveData(data, scene) {
}
if
(
obj
)
{
if
(
textFont
)
{
let
txt
=
data
[
i
].
ID
.
substr
(
data
[
i
].
ID
.
length
-
5
,
data
[
i
].
ID
.
length
)
+
"."
+
data
[
i
].
PtcHeading
.
substr
(
0
,
3
);
//data[i].ID.substr(data[i].ID.length - 5, data[i].ID.length)
var
geometry
=
new
THREE
.
TextGeometry
(
txt
,
{
font
:
textFont
,
size
:
1
,
height
:
0.1
,
curveSegments
:
1
});
//创建法向量材质
var
meshMaterial
=
new
THREE
.
MeshNormalMaterial
({
flatShading
:
THREE
.
FlatShading
,
transparent
:
true
,
opacity
:
1
});
textObj
=
new
THREE
.
Mesh
(
geometry
,
meshMaterial
);
textObj
.
position
.
set
(
pos
[
0
],
pos
[
1
],
30
);
scene
.
add
(
textObj
);
scene
.
remove
(
obj
.
textObj
);
obj
.
textObj
=
textObj
;
}
obj
.
textObj
.
position
.
set
(
pos
[
0
],
pos
[
1
],
30
);
obj
.
carObj
.
position
.
set
(
pos
[
0
],
pos
[
1
],
heightz
);
let
heading
=
parseFloat
(
data
[
i
].
PtcHeading
)
...
...
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