Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ehasa-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WIMMA Lab 2019
Overflow
ehasa-frontend
Commits
9c93f1eb
Commit
9c93f1eb
authored
5 years ago
by
L4168
Browse files
Options
Downloads
Patches
Plain Diff
some comments
parent
ead9bc61
No related branches found
No related tags found
2 merge requests
!46
Development to testing
,
!33
Game replay
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/track-playback/src/leaflet.trackplayback/draw.js
+6
-1
6 additions, 1 deletion
src/track-playback/src/leaflet.trackplayback/draw.js
with
6 additions
and
1 deletion
src/track-playback/src/leaflet.trackplayback/draw.js
+
6
−
1
View file @
9c93f1eb
...
@@ -128,6 +128,7 @@ export const Draw = L.Class.extend({
...
@@ -128,6 +128,7 @@ export const Draw = L.Class.extend({
}
}
},
},
// changes cursor icon to pointer and shows information about tracked player
_onmousemoveEvt
:
function
(
e
)
{
_onmousemoveEvt
:
function
(
e
)
{
if
(
!
this
.
_showTrackPoint
)
{
if
(
!
this
.
_showTrackPoint
)
{
return
;
return
;
...
@@ -147,6 +148,7 @@ export const Draw = L.Class.extend({
...
@@ -147,6 +148,7 @@ export const Draw = L.Class.extend({
this
.
_canvas
.
style
.
cursor
=
"
grab
"
;
this
.
_canvas
.
style
.
cursor
=
"
grab
"
;
},
},
// on click event that shows popup about tracked player
_onmouseclickEvt
:
function
(
e
)
{
_onmouseclickEvt
:
function
(
e
)
{
if
(
!
this
.
_showTrackPoint
)
{
if
(
!
this
.
_showTrackPoint
)
{
return
;
return
;
...
@@ -173,7 +175,6 @@ export const Draw = L.Class.extend({
...
@@ -173,7 +175,6 @@ export const Draw = L.Class.extend({
if
(
this
.
_map
.
hasLayer
(
this
.
_tooltip
))
{
if
(
this
.
_map
.
hasLayer
(
this
.
_tooltip
))
{
this
.
_map
.
removeLayer
(
this
.
_tooltip
);
this
.
_map
.
removeLayer
(
this
.
_tooltip
);
}
}
//this._canvas.style.cursor = "default";
let
latlng
=
L
.
latLng
(
trackpoint
.
lat
,
trackpoint
.
lng
);
let
latlng
=
L
.
latLng
(
trackpoint
.
lat
,
trackpoint
.
lng
);
let
tooltip
=
(
this
.
_tooltip
=
L
.
tooltip
(
this
.
toolTipOptions
));
let
tooltip
=
(
this
.
_tooltip
=
L
.
tooltip
(
this
.
toolTipOptions
));
tooltip
.
setLatLng
(
latlng
);
tooltip
.
setLatLng
(
latlng
);
...
@@ -299,6 +300,7 @@ export const Draw = L.Class.extend({
...
@@ -299,6 +300,7 @@ export const Draw = L.Class.extend({
this
.
_ctx
.
restore
();
this
.
_ctx
.
restore
();
},
},
// used to draw image for tracking data
_drawShipImage
:
function
(
trackpoint
,
info
)
{
_drawShipImage
:
function
(
trackpoint
,
info
)
{
let
point
=
this
.
_getLayerPoint
(
trackpoint
);
let
point
=
this
.
_getLayerPoint
(
trackpoint
);
let
width
=
this
.
targetOptions
.
width
;
let
width
=
this
.
targetOptions
.
width
;
...
@@ -310,11 +312,13 @@ export const Draw = L.Class.extend({
...
@@ -310,11 +312,13 @@ export const Draw = L.Class.extend({
this
.
_ctx
.
save
();
this
.
_ctx
.
save
();
this
.
_ctx
.
translate
(
point
.
x
,
point
.
y
);
this
.
_ctx
.
translate
(
point
.
x
,
point
.
y
);
let
image
;
let
image
;
// use an existing image if it has the same icon as the new data
this
.
_targetImg
.
map
(
img
=>
{
this
.
_targetImg
.
map
(
img
=>
{
if
(
img
.
icon
==
info
[
0
][
"
value
"
])
{
if
(
img
.
icon
==
info
[
0
][
"
value
"
])
{
image
=
img
;
image
=
img
;
}
}
});
});
// else create a new global image with new icon
if
(
!
image
)
{
if
(
!
image
)
{
let
img
=
new
Image
();
let
img
=
new
Image
();
img
.
onload
=
()
=>
{
img
.
onload
=
()
=>
{
...
@@ -328,6 +332,7 @@ export const Draw = L.Class.extend({
...
@@ -328,6 +332,7 @@ export const Draw = L.Class.extend({
image
=
img
;
image
=
img
;
}
}
this
.
_ctx
.
drawImage
(
image
,
0
-
offset
.
x
,
0
-
offset
.
y
,
width
,
height
);
this
.
_ctx
.
drawImage
(
image
,
0
-
offset
.
x
,
0
-
offset
.
y
,
width
,
height
);
// draw rect based on faction colour
this
.
_ctx
.
strokeStyle
=
info
[
1
][
"
value
"
];
this
.
_ctx
.
strokeStyle
=
info
[
1
][
"
value
"
];
this
.
_ctx
.
lineWidth
=
3
;
this
.
_ctx
.
lineWidth
=
3
;
this
.
_ctx
.
strokeRect
(
0
-
offset
.
x
,
0
-
offset
.
y
,
width
,
height
);
this
.
_ctx
.
strokeRect
(
0
-
offset
.
x
,
0
-
offset
.
y
,
width
,
height
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment