Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
web-tool
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
tool
web-tool
Commits
53e8398f
Commit
53e8398f
authored
Jul 18, 2023
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除文件
parent
6238ddc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
75 deletions
+0
-75
CalcCoorArrUtil.js
packages/graphmod-utils/src/CalcCoorArrUtil.js
+0
-74
index.js
packages/graphmod-utils/src/index.js
+0
-1
No files found.
packages/graphmod-utils/src/CalcCoorArrUtil.js
deleted
100644 → 0
View file @
6238ddc3
/**
* 直线生成平滑曲线Util
* @param {point_start} 起点经纬度
* @param {point_end} 终点经纬度
* @param {num} 生成点个数
* @param {key} 曲线弯曲程度
*/
export
const
calcCoorArrUtil
=
(
point_start
,
point_end
,
num
,
key
)
=>
{
let
p_start
=
{
x
:
point_start
.
lng
,
y
:
point_start
.
lat
};
let
p_end
=
{
x
:
point_end
.
lng
,
y
:
point_end
.
lat
};
let
x3
=
(
p_start
.
x
*
key
+
p_end
.
x
*
key
-
p_start
.
y
+
p_end
.
y
)
/
(
2
*
key
);
let
y3
=
(
p_start
.
y
*
key
+
p_end
.
y
*
key
-
p_end
.
x
+
p_start
.
x
)
/
(
2
*
key
);
let
p_crt1
=
{
x
:
x3
,
y
:
y3
};
let
p_crt2
=
{
x
:
x3
,
y
:
y3
};
let
paths
=
[];
for
(
let
i
=
0
;
i
<
num
+
1
;
i
++
)
{
let
t
=
i
/
num
;
let
_matrix1
=
[
1
,
t
,
t
*
t
,
t
*
t
*
t
];
let
_matrix2
=
[
[
1
,
0
,
0
,
0
],
[
-
3
,
3
,
0
,
0
],
[
3
,
-
6
,
3
,
0
],
[
-
1
,
3
,
-
3
,
1
]
];
let
_matrix3
=
[
[
p_start
.
x
,
p_start
.
y
],
[
p_crt1
.
x
,
p_crt1
.
y
],
[
p_crt2
.
x
,
p_crt2
.
y
],
[
p_end
.
x
,
p_end
.
y
]
];
let
_matrix_tmp
=
[
_matrix1
[
0
]
*
_matrix2
[
0
][
0
]
+
_matrix1
[
1
]
*
_matrix2
[
1
][
0
]
+
_matrix1
[
2
]
*
_matrix2
[
2
][
0
]
+
_matrix1
[
3
]
*
_matrix2
[
3
][
0
],
_matrix1
[
0
]
*
_matrix2
[
0
][
1
]
+
_matrix1
[
1
]
*
_matrix2
[
1
][
1
]
+
_matrix1
[
2
]
*
_matrix2
[
2
][
1
]
+
_matrix1
[
3
]
*
_matrix2
[
3
][
1
],
_matrix1
[
0
]
*
_matrix2
[
0
][
2
]
+
_matrix1
[
1
]
*
_matrix2
[
1
][
2
]
+
_matrix1
[
2
]
*
_matrix2
[
2
][
2
]
+
_matrix1
[
3
]
*
_matrix2
[
3
][
2
],
_matrix1
[
0
]
*
_matrix2
[
0
][
3
]
+
_matrix1
[
1
]
*
_matrix2
[
1
][
3
]
+
_matrix1
[
2
]
*
_matrix2
[
2
][
3
]
+
_matrix1
[
3
]
*
_matrix2
[
3
][
3
]
];
let
_matrix_final
=
[
_matrix_tmp
[
0
]
*
_matrix3
[
0
][
0
]
+
_matrix_tmp
[
1
]
*
_matrix3
[
1
][
0
]
+
_matrix_tmp
[
2
]
*
_matrix3
[
2
][
0
]
+
_matrix_tmp
[
3
]
*
_matrix3
[
3
][
0
],
_matrix_tmp
[
0
]
*
_matrix3
[
0
][
1
]
+
_matrix_tmp
[
1
]
*
_matrix3
[
1
][
1
]
+
_matrix_tmp
[
2
]
*
_matrix3
[
2
][
1
]
+
_matrix_tmp
[
3
]
*
_matrix3
[
3
][
1
]
];
let
_res_point
=
[
_matrix_final
[
1
],
_matrix_final
[
0
]];
paths
.
push
(
{
longitude
:
_matrix_final
[
0
],
latitude
:
_matrix_final
[
1
]
}
);
}
return
paths
;
};
/**
* 语言播放
*/
export
function
text2Speech
(
content
){
if
(
'speechSynthesis'
in
window
)
{
let
sentence
=
new
SpeechSynthesisUtterance
(
content
);
let
voices
=
window
.
speechSynthesis
.
getVoices
();
for
(
let
i
=
0
;
i
<
voices
.
length
;
i
++
)
{
if
(
voices
[
i
].
name
===
'Alex'
)
{
sentence
.
voice
=
voices
[
i
];
}
}
sentence
.
pitch
=
1
;
sentence
.
rate
=
1.5
;
// 速度
sentence
.
text
=
content
;
window
.
speechSynthesis
.
speak
(
sentence
);
}
else
{
console
.
log
(
'当前浏览器不支持语音朗读.'
);
}
}
packages/graphmod-utils/src/index.js
View file @
53e8398f
export
*
from
'./CalcCoorArrUtil'
;
export
{
default
as
EsEnum
}
from
'./Enum'
;
export
{
default
as
Event
}
from
'./Event'
;
export
*
as
FileUtils
from
'./FileUtils'
;
...
...
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