|
44 | 44 | <l-marker |
45 | 45 | :lat-lng="getMidpointLatLng([vote.lng, vote.lat])" |
46 | 46 | v-if="!vote.isCorrect && humanizeDistance(vote, room.country, true) > 200" |
47 | | - :icon="createDistanceIcon(humanizeDistance(vote, room.country, true), vote.color)" |
| 47 | + :icon="createDistanceIcon([vote.lng, vote.lat], humanizeDistance(vote, room.country, true), vote.color, vote.player)" |
48 | 48 | ></l-marker> |
49 | 49 | </template> |
50 | 50 | </template> |
|
67 | 67 | <l-marker |
68 | 68 | v-if="humanizeDistance({lat: marker.position[1], lng: marker.position[0]}, room.country, true) > 200" |
69 | 69 | :lat-lng="getMidpointLatLng(marker.position)" |
70 | | - :icon="createDistanceIcon(marker.position, humanizeDistance({lat: marker.position[1], lng: marker.position[0]}, room.country, true), pinColor)" |
| 70 | + :icon="createDistanceIcon(marker.position, humanizeDistance({lat: marker.position[1], lng: marker.position[0]}, room.country, true, room.player), pinColor)" |
71 | 71 | ></l-marker> |
72 | 72 | </template> |
73 | 73 |
|
@@ -118,7 +118,8 @@ import distanceBetween from "~/utils/functions/distanceBetween"; |
118 | 118 | export default class GameMap extends Vue { |
119 | 119 | @Prop() room: Room |
120 | 120 |
|
121 | | - pinSet = false |
| 121 | + pinSet = false; |
| 122 | + showNames = false; |
122 | 123 |
|
123 | 124 | get countryIcon() { |
124 | 125 | const iconUrl = imageUrl(isoToCountryCode(this.room.country.alpha2code).toUpperCase(), "l"); |
@@ -176,7 +177,15 @@ export default class GameMap extends Vue { |
176 | 177 | return [midLng, midLat]; |
177 | 178 | } |
178 | 179 |
|
179 | | - createDistanceIcon(coords, distance, color) { |
| 180 | + createDistanceIcon(coords, distance, color, player) { |
| 181 | + if (player) { |
| 182 | + return divIcon({ |
| 183 | + className: 'distance-label', |
| 184 | + html: `<div style=" |
| 185 | + white-space: nowrap; |
| 186 | + display: inline-block !important;background-color: ${color}; width: unset !important; !important; font-size: 13px; padding: 2px 2px !important; font-weight: bold; border-radius: 3px; color: black;">${player.username}: ${distance} km</div>`, |
| 187 | + }); |
| 188 | + } |
180 | 189 | return divIcon({ |
181 | 190 | className: 'distance-label', |
182 | 191 | html: `<div style=" |
|
0 commit comments