|
@@ -54,7 +54,18 @@ const headingStyle = (lineRadius, headAngle, rotation) => {
|
|
|
const ShipNormalStyle = ({course = 0, speed = 0, head = null, color = '#01f200', mergeType = 'OTHER'}) => {
|
|
|
const _style: any = []
|
|
|
const allRotation = Math.PI / (180 / course)
|
|
|
- const lineRadius = speed * 5
|
|
|
+ let lineRadius = 0
|
|
|
+ if (speed > 0) {
|
|
|
+ if (speed <= 5) {
|
|
|
+ lineRadius = 2
|
|
|
+ } else if (speed <= 10) {
|
|
|
+ lineRadius = 6
|
|
|
+ } else if (speed <= 20) {
|
|
|
+ lineRadius = 18
|
|
|
+ } else if (speed > 20) {
|
|
|
+ lineRadius = 30
|
|
|
+ }
|
|
|
+ }
|
|
|
// 船速
|
|
|
_style.push(speedStyle(lineRadius, allRotation))
|
|
|
if (head) {
|