Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Front-end app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IPos-public
Front-end app
Commits
c406c5db
Commit
c406c5db
authored
3 years ago
by
Oleksandr Husak
Browse files
Options
Downloads
Patches
Plain Diff
waypoint: spelling mistake, color and message structure
parent
7d20d803
Branches
master
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
src/app/components/map/map.component.ts
+12
-11
12 additions, 11 deletions
src/app/components/map/map.component.ts
src/app/model/base-model.ts
+5
-5
5 additions, 5 deletions
src/app/model/base-model.ts
with
18 additions
and
17 deletions
README.md
+
1
−
1
View file @
c406c5db
...
...
@@ -73,7 +73,7 @@ Connection settings
```
-
More objects can be added to the
`"object": []`
-
There are special colours for objects. Config:
[
MarkerColorList
](
src/environments/environment.ts
)
-
topic
`ipos/client/way`
-
topic
`ipos/client/way
point
`
-
new way points
-
```json
[
...
...
This diff is collapsed.
Click to expand it.
src/app/components/map/map.component.ts
+
12
−
11
View file @
c406c5db
...
...
@@ -69,11 +69,13 @@ export class MapComponent implements OnInit {
// --- Agent waypoints
this
.
subsWayPoint
=
this
.
_mqttService
.
observe
(
'
ipos/client/way
'
).
subscribe
((
message
:
IMqttMessage
)
=>
{
this
.
subsWayPoint
=
this
.
_mqttService
.
observe
(
'
ipos/client/way
point
'
).
subscribe
((
message
:
IMqttMessage
)
=>
{
try
{
let
points
:
WayPoint
[]
=
<
WayPoint
[]
>
JSON
.
parse
(
message
.
payload
.
toString
())
console
.
log
(
points
)
if
(
!
(
Array
.
isArray
(
points
)))
{
points
=
[
points
]
}
points
.
forEach
(
wayPoint
=>
{
if
(
isWayPoint
(
wayPoint
))
{
...
...
@@ -143,21 +145,21 @@ export class MapComponent implements OnInit {
registerWayPoint
(
wayPoint
:
WayPoint
)
{
// empty position
if
(
wayPoint
.
position
==
undefined
)
{
console
.
log
(
"
Error: empty position.
"
)
console
.
log
(
"
Error: empty
waypoint
position.
"
)
return
}
// empty position
if
(
Object
.
values
(
wayPoint
.
position
).
every
((
e
)
=>
{
e
==
undefined
}))
{
console
.
log
(
"
Error: empty po
int
.
"
)
console
.
log
(
"
Error: empty po
sition
.
"
)
return
;
}
let
key
=
wayPoint
.
agentId
// --- Marker config
let
serialNum
=
Object
.
keys
(
this
.
markOverlays
).
indexOf
(
key
)
var
markerConf
=
getMarkerConfig
(
serialNum
)
//
let serialNum = Object.keys(this.markOverlays).indexOf(key)
// ref to markers
//
var markerConf = getMarkerConfig(serialNum)
// --- Layer on the map
if
(
!
(
key
in
this
.
wayPointsOverlays
))
{
...
...
@@ -173,14 +175,13 @@ export class MapComponent implements OnInit {
}
// --- Marker
let
markerDesc
=
`<p> \
<h
4
>Way
point</h
4
>
<h
3
>Waypoint</h
3
>
<strong>Agent</strong>:
${
wayPoint
.
agentId
}
<br>\
<strong>Time</strong>:
${
wayPoint
.
time
}
<br>
</p>`
let
marker
=
L
.
circleMarker
(
globPos
,
{
radius
:
5
,
color
:
markerConf
.
color
}).
bindPopup
(
markerDesc
).
openPopup
();
let
marker
=
L
.
circleMarker
(
globPos
,
{
radius
:
5
,
color
:
"
#d97b16
"
}).
bindPopup
(
markerDesc
).
openPopup
();
marker
.
addTo
(
this
.
wayPointsOverlays
[
key
])
}
...
...
This diff is collapsed.
Click to expand it.
src/app/model/base-model.ts
+
5
−
5
View file @
c406c5db
...
...
@@ -114,11 +114,11 @@ export function isAgent(obj: any): obj is Agent {
// --- Way points
export
interface
WayPoint
{
"
agentId
"
:
string
"
agentType
"
?:
AgentType
"
publisher
"
?:
string
"
position
"
:
Position
"
time
"
:
string
agentId
:
string
agentType
?:
AgentType
publisher
?:
string
position
:
Position
time
:
string
}
...
...
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