designsss

This commit is contained in:
LionTion committed 2026-09-20 21:46:48 +02:00
1 parent 9401ef3a9e
commit eb64159275
5 files changed
+225 -60

No files matched your search

+20 -7
View File
@@ -1,6 +1,6 @@
'use client';
import React, { useEffect, useRef, useState, useCallback } from 'react';
import React, { useEffect, useRef, useState, useCallback, createElement } from 'react';
import * as maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';
import styles from '@/css/MapView.module.css';
@@ -73,7 +73,7 @@ export default function MapView({
source: 'osm-tiles',
minzoom: 0,
maxzoom: 19,
},
}
],
};
@@ -86,14 +86,21 @@ export default function MapView({
map.addControl(new maplibregl.NavigationControl({ visualizePitch: true }), 'bottom-right');
const el = document.createElement("img");
el.src = "/icons/person.svg";
el.alt = "You";
el.width = 42;
el.className = styles["sword"];
const geolocate = new maplibregl.GeolocateControl({
positionOptions: {
enableHighAccuracy: true,
},
trackUserLocation: true,
showUserLocation: true,
showAccuracyCircle: true,
showAccuracyCircle: false,
});
geolocate._dotElement = el;
map.addControl(geolocate, 'bottom-right');
map.addControl(new maplibregl.ScaleControl({ unit: 'metric' }), 'bottom-left');
@@ -135,15 +142,21 @@ export default function MapView({
markers.forEach((markerData) => {
if (!currentMarkers.has(markerData.id)) {
const popup = new maplibregl.Popup({ offset: 25, className: styles["marker"] }).setHTML(
/*const popup = new maplibregl.Popup({ offset: 25, className: styles["marker"] }).setHTML(
`<strong>${markerData.title}</strong>${
markerData.description ? `<p style="margin:4px 0 0;font-size:12px;">${markerData.description}</p>` : ''
}`
);
);*/
const newMarker = new maplibregl.Marker({ color: '#e11d48', })
const el = document.createElement("img");
el.src = "/icons/Schwert-gps.svg";
el.alt = "GPS Point";
el.width = 80;
el.className = styles["sword"];
const newMarker = new maplibregl.Marker({ element: el, anchor: "bottom" })
.setLngLat([markerData.lng, markerData.lat])
.setPopup(popup)
//.setPopup(popup)
.addTo(map);
newMarker.getElement().addEventListener('click', () => {