mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Implement 'isPreparedForMarkers' and set a watcher, because sometimes the current users pin is missing
This commit is contained in:
parent
81f2840a95
commit
0f21a92a84
@ -117,6 +117,15 @@ export default {
|
|||||||
...mapGetters({
|
...mapGetters({
|
||||||
currentUser: 'auth/user',
|
currentUser: 'auth/user',
|
||||||
}),
|
}),
|
||||||
|
isPreparedForMarkers() {
|
||||||
|
return (
|
||||||
|
!this.markers.isGeoJSON &&
|
||||||
|
this.markers.isImagesLoaded &&
|
||||||
|
this.currentUser &&
|
||||||
|
this.users &&
|
||||||
|
this.groups
|
||||||
|
)
|
||||||
|
},
|
||||||
styles() {
|
styles() {
|
||||||
return objectValuesToArray(this.availableStyles)
|
return objectValuesToArray(this.availableStyles)
|
||||||
},
|
},
|
||||||
@ -160,6 +169,13 @@ export default {
|
|||||||
return this.currentUserCoordinates ? 10 : 4
|
return this.currentUserCoordinates ? 10 : 4
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
isPreparedForMarkers(newValue) {
|
||||||
|
if (newValue) {
|
||||||
|
this.addMarkersOnCheckPrepared()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onMapLoad({ map }) {
|
onMapLoad({ map }) {
|
||||||
this.map = map
|
this.map = map
|
||||||
@ -293,13 +309,7 @@ export default {
|
|||||||
},
|
},
|
||||||
addMarkersOnCheckPrepared() {
|
addMarkersOnCheckPrepared() {
|
||||||
// set geoJSON for markers
|
// set geoJSON for markers
|
||||||
if (
|
if (this.isPreparedForMarkers) {
|
||||||
!this.markers.isGeoJSON &&
|
|
||||||
this.markers.isImagesLoaded &&
|
|
||||||
this.currentUser &&
|
|
||||||
this.users &&
|
|
||||||
this.groups
|
|
||||||
) {
|
|
||||||
// add markers for "users"
|
// add markers for "users"
|
||||||
this.users.forEach((user) => {
|
this.users.forEach((user) => {
|
||||||
if (user.id !== this.currentUser.id && user.location) {
|
if (user.id !== this.currentUser.id && user.location) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user