Added player popup
This commit is contained in:
@@ -16,21 +16,20 @@
|
|||||||
.title {
|
.title {
|
||||||
display: block;
|
display: block;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
text-underline-offset: 2px;
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
strong.title {
|
strong.title {
|
||||||
color: #16a34a;
|
color: #16a34a;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.title:hover {
|
a.title {
|
||||||
text-decoration: none;
|
text-underline-offset: 2px;
|
||||||
color: #16a34a;
|
text-decoration: underline;
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #16a34a;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
> * + * {
|
> * + * {
|
||||||
|
|||||||
@@ -133,6 +133,14 @@ if ( players ) {
|
|||||||
|
|
||||||
const playerMarker = L.marker(playersPosition, { icon: playerIcon }).addTo(map)
|
const playerMarker = L.marker(playersPosition, { icon: playerIcon }).addTo(map)
|
||||||
playerMarker.addTo(layerGroups['players'])
|
playerMarker.addTo(layerGroups['players'])
|
||||||
|
|
||||||
|
const popupContent = `
|
||||||
|
<strong class="title">
|
||||||
|
${players.title}
|
||||||
|
</strong>
|
||||||
|
<p>${players.description}</p>
|
||||||
|
`;
|
||||||
|
playerMarker.bindPopup(popupContent).openPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
map.fitBounds(layer.getBounds());
|
map.fitBounds(layer.getBounds());
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { deepMap, onMount, task } from 'nanostores'
|
import { deepMap, onMount, task } from 'nanostores'
|
||||||
import type { MapMarker } from '../../types/Leaflet';
|
import type { MapMarker, PlayerMarker } from '../../types/Leaflet';
|
||||||
|
|
||||||
export const $world = deepMap({
|
export const $world = deepMap({
|
||||||
markers: [] as MapMarker[],
|
markers: [] as MapMarker[],
|
||||||
players: {} as MapMarker,
|
players: {} as PlayerMarker,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Fetch initial data
|
// Fetch initial data
|
||||||
|
|||||||
@@ -6,4 +6,5 @@ export const playerPosition: PlayerMarker = {
|
|||||||
x: 162.05197
|
x: 162.05197
|
||||||
},
|
},
|
||||||
title: "L'Éclipse",
|
title: "L'Éclipse",
|
||||||
|
description: "Tara Belyus, Vascylly et Adol Sulvan livrent 3 condamnés à Handany."
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user