Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
group23_com2027
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package 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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Henine, Didou (UG - SISC)
group23_com2027
Commits
352a778e
Commit
352a778e
authored
4 years ago
by
Endrizzi, Marco (UG - Comp Sci & Elec Eng)
Browse files
Options
Downloads
Patches
Plain Diff
bad fix for users not being responsive
parent
2c50cb1a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/GoogleMap.vue
+8
-9
8 additions, 9 deletions
src/components/GoogleMap.vue
src/store/firebase.js
+3
-0
3 additions, 0 deletions
src/store/firebase.js
with
11 additions
and
9 deletions
src/components/GoogleMap.vue
+
8
−
9
View file @
352a778e
...
...
@@ -19,8 +19,9 @@ q-btn(
</
template
>
<
script
>
import
{
mapState
,
mapActions
}
from
'
vuex
'
import
{
mapState
,
mapActions
,
mapGetters
}
from
'
vuex
'
import
axios
from
'
axios
'
var
userMarkers
=
{}
export
default
{
name
:
'
GoogleMap
'
,
...
...
@@ -32,7 +33,6 @@ export default {
heatmap
:
null
,
places
:
[],
crimes
:
[],
userMarkers
:
{},
dataFetched
:
false
}
},
...
...
@@ -344,17 +344,16 @@ export default {
mapsAddUserMarker
(
userId
)
{
var
userPosition
=
this
.
users
[
userId
].
position
let
marker
=
new
google
.
maps
.
Marker
({
userMarkers
[
userId
]
=
new
google
.
maps
.
Marker
({
position
:
new
google
.
maps
.
LatLng
(
userPosition
.
lat
,
userPosition
.
lng
),
map
:
this
.
map
,
icon
:
'
https://img.icons8.com/nolan/64/men-age-group-4--v2.png
'
})
this
.
userMarkers
[
userId
]
=
marker
},
mapsRemoveUserMarker
(
userId
)
{
this
.
userMarkers
[
userId
].
setMap
(
null
)
delete
this
.
userMarkers
[
userId
]
userMarkers
[
userId
].
setMap
(
null
)
delete
userMarkers
[
userId
]
},
...
mapActions
(
'
firebase
'
,
[
'
firebaseSavePosition
'
])
...
...
@@ -370,13 +369,13 @@ export default {
'
latestSignalKey
'
,
'
events
'
,
'
latestEventKey
'
])
]),
...
mapGetters
(
'
firebase
'
,
[
'
latestUserChange
'
])
},
watch
:
{
latestUserChange
:
{
deep
:
true
,
immediate
:
true
,
// Whenever a new event gets added, add it to the map
handler
()
{
if
(
this
.
latestUserChange
.
type
==
'
add
'
)
{
...
...
@@ -413,7 +412,7 @@ export default {
}
},
async
moun
ted
()
{
async
crea
ted
()
{
// Wait for current location to be fetched and saved to store
await
this
.
geolocate
()
// Wait for map and map components to be loaded
...
...
This diff is collapsed.
Click to expand it.
src/store/firebase.js
+
3
−
0
View file @
352a778e
...
...
@@ -433,6 +433,9 @@ const getters = {
// Return the property names for the userDetails object
userDetailsKeys
:
state
=>
{
return
Object
.
keys
(
state
.
userDetails
)
},
latestUserChange
:
state
=>
{
return
state
.
latestUserChange
}
}
...
...
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