diff --git a/src/components/maps/WorldMap.astro b/src/components/maps/WorldMap.astro index 7e969e2a..a7b0f951 100644 --- a/src/components/maps/WorldMap.astro +++ b/src/components/maps/WorldMap.astro @@ -158,7 +158,8 @@ for (let i = 0; i < markers.length; i++) { /** * Add player's position marker */ -if ( players ) { +if ( players && Object.keys(players).length > 0 ) { + console.log(players) const playersPosition =[ convertYToScale(players.markerCoords.y), convertXToScale(players.markerCoords.x) diff --git a/src/components/maps/overlay/SearchMarkers.vue b/src/components/maps/overlay/SearchMarkers.vue index b71475da..59aa6176 100644 --- a/src/components/maps/overlay/SearchMarkers.vue +++ b/src/components/maps/overlay/SearchMarkers.vue @@ -60,6 +60,8 @@ onMounted(() => { }) }) +const hasPlayers = computed(() => Object.keys(props.players).length > 0) + /** * Marker geolocation * We need to use onUpdated hook because the list is not always rendered, and it often rebuilt. @@ -83,7 +85,7 @@ onUpdated(() => { -