cosmetic changes
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
export let large: boolean = false;
|
export let large: boolean = false;
|
||||||
export let type: "trail" | "list"
|
export let type: "trail" | "list"
|
||||||
|
|
||||||
const shareData = type == "trail" ? (subject as Trail).expand.trail_share_via_trail : (subject as List).expand?.list_share_via_list
|
const shareData = type == "trail" ? (subject as Trail).expand?.trail_share_via_trail : (subject as List).expand?.list_share_via_list
|
||||||
|
|
||||||
let showInfo: boolean = false;
|
let showInfo: boolean = false;
|
||||||
let loading: boolean = false;
|
let loading: boolean = false;
|
||||||
|
|||||||
@@ -110,6 +110,8 @@
|
|||||||
elevationGridColor: "#ddd2",
|
elevationGridColor: "#ddd2",
|
||||||
labelColor: "#ddd8",
|
labelColor: "#ddd8",
|
||||||
crosshairColor: "#fff5",
|
crosshairColor: "#fff5",
|
||||||
|
tooltipBackgroundColor: "#242734",
|
||||||
|
tooltipTextColor: "#fff",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
epc?.toggleTheme({
|
epc?.toggleTheme({
|
||||||
@@ -117,6 +119,8 @@
|
|||||||
elevationGridColor: "#0002",
|
elevationGridColor: "#0002",
|
||||||
labelColor: "#0009",
|
labelColor: "#0009",
|
||||||
crosshairColor: "#0005",
|
crosshairColor: "#0005",
|
||||||
|
tooltipBackgroundColor: "#fff",
|
||||||
|
tooltipTextColor: "#000",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,10 +189,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
refreshElevationProfile();
|
refreshElevationProfile();
|
||||||
if (showElevation && data.length) {
|
if (showElevation && data.length && activeTrail !== null) {
|
||||||
epc?.showProfile();
|
epc?.showProfile();
|
||||||
|
} else {
|
||||||
|
epc?.hideProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
trails.forEach((t, i) => {
|
trails.forEach((t, i) => {
|
||||||
const layerId = t.id!;
|
const layerId = t.id!;
|
||||||
addTrailLayer(t, layerId, i, data[i]);
|
addTrailLayer(t, layerId, i, data[i]);
|
||||||
@@ -212,8 +217,8 @@
|
|||||||
} else {
|
} else {
|
||||||
flyToBounds();
|
flyToBounds();
|
||||||
}
|
}
|
||||||
} else if(drawing && activeTrail !== null && mapLoaded) {
|
} else if (drawing && activeTrail !== null && mapLoaded) {
|
||||||
addCaretLayer(trails[activeTrail]?.id)
|
addCaretLayer(trails[activeTrail]?.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,7 +355,7 @@
|
|||||||
highlightTrail(id, trails[activeTrail ?? -1]?.id == id);
|
highlightTrail(id, trails[activeTrail ?? -1]?.id == id);
|
||||||
layers[id].listener.onLeave = (e) => unHighlightTrail(id);
|
layers[id].listener.onLeave = (e) => unHighlightTrail(id);
|
||||||
layers[id].listener.onMouseUp = (e) => {
|
layers[id].listener.onMouseUp = (e) => {
|
||||||
activeTrail = trails.findIndex(t => t.id == trail.id);
|
activeTrail = trails.findIndex((t) => t.id == trail.id);
|
||||||
};
|
};
|
||||||
layers[id].listener.onMouseMove = moveCrosshairToCursorPosition;
|
layers[id].listener.onMouseMove = moveCrosshairToCursorPosition;
|
||||||
layers[id].listener.onMouseDown = (e) => handDragStart(e, id);
|
layers[id].listener.onMouseDown = (e) => handDragStart(e, id);
|
||||||
@@ -479,11 +484,6 @@
|
|||||||
activeTrail = null;
|
activeTrail = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentlyFocussedTrail = trails[activeTrail];
|
|
||||||
if (currentlyFocussedTrail && currentlyFocussedTrail != trail) {
|
|
||||||
unFocusTrail(currentlyFocussedTrail);
|
|
||||||
}
|
|
||||||
dispatch("select", trail);
|
dispatch("select", trail);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -567,6 +567,10 @@
|
|||||||
|
|
||||||
const startEndPoint = findStartAndEndPoints(geojson);
|
const startEndPoint = findStartAndEndPoints(geojson);
|
||||||
|
|
||||||
|
if(!startEndPoint.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
layers[id].startMarker
|
layers[id].startMarker
|
||||||
.setLngLat(startEndPoint[0] as M.LngLatLike)
|
.setLngLat(startEndPoint[0] as M.LngLatLike)
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
@@ -741,6 +745,8 @@
|
|||||||
profileLineWidth: 3,
|
profileLineWidth: 3,
|
||||||
displayDistanceGrid: true,
|
displayDistanceGrid: true,
|
||||||
tooltipDisplayDPlus: false,
|
tooltipDisplayDPlus: false,
|
||||||
|
tooltipBackgroundColor: $theme == "light" ? "#fff" : "#242734",
|
||||||
|
tooltipTextColor: $theme == "light" ? "#000" : "#fff",
|
||||||
zoom: false,
|
zoom: false,
|
||||||
container: elevationProfileContainer,
|
container: elevationProfileContainer,
|
||||||
onEnter: () => {
|
onEnter: () => {
|
||||||
@@ -856,11 +862,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
:global(.maplibregl-popup-content) {
|
:global(.maplibregl-popup-content) {
|
||||||
@apply bg-background rounded-md;
|
@apply bg-background rounded-md shadow-xl pt-5;
|
||||||
}
|
}
|
||||||
|
|
||||||
:global(.maplibregl-popup-close-button) {
|
:global(.maplibregl-popup-close-button) {
|
||||||
top: 4px;
|
top: 4px;
|
||||||
right: 8px;
|
right: 8px;
|
||||||
|
line-height: 0;
|
||||||
|
padding-bottom: 2.5px;
|
||||||
|
@apply bg-menu-item-background-focus w-3 aspect-square rounded-full;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -161,7 +161,7 @@
|
|||||||
alt=""
|
alt=""
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="absolute bottom-0 w-full h-2/3 bg-gradient-to-b from-transparent to-black opacity-50"
|
class="absolute bottom-0 w-full h-full bg-gradient-to-b from-transparent to-black opacity-60"
|
||||||
></div>
|
></div>
|
||||||
{#if (trail.public || trailIsShared) && pb.authStore.model}
|
{#if (trail.public || trailIsShared) && pb.authStore.model}
|
||||||
<div
|
<div
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
>
|
>
|
||||||
{#if trail.public && pb.authStore.model}
|
{#if trail.public && pb.authStore.model}
|
||||||
<span
|
<span
|
||||||
class="tooltip text-2xl"
|
class="tooltip"
|
||||||
class:mr-3={trail.public && trailIsShared}
|
class:mr-3={trail.public && trailIsShared}
|
||||||
data-title={$_("public")}
|
data-title={$_("public")}
|
||||||
>
|
>
|
||||||
@@ -180,7 +180,7 @@
|
|||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
{#if trailIsShared}
|
{#if trailIsShared}
|
||||||
<ShareInfo type="trail" subject={trail} large={true}
|
<ShareInfo type="trail" subject={trail}
|
||||||
></ShareInfo>
|
></ShareInfo>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
"removed-trail-from": "Route entfernt aus",
|
"removed-trail-from": "Route entfernt aus",
|
||||||
"required": "Pflichtfeld",
|
"required": "Pflichtfeld",
|
||||||
"reset-password": "Passwort zurücksetzen",
|
"reset-password": "Passwort zurücksetzen",
|
||||||
|
"route-point": "",
|
||||||
"save": "Speichern",
|
"save": "Speichern",
|
||||||
"save-list": "Liste speichern",
|
"save-list": "Liste speichern",
|
||||||
"save-trail": "Route speichern",
|
"save-trail": "Route speichern",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
"removed-trail-from": "Removed trail from",
|
"removed-trail-from": "Removed trail from",
|
||||||
"required": "Required",
|
"required": "Required",
|
||||||
"reset-password": "Reset Password",
|
"reset-password": "Reset Password",
|
||||||
|
"route-point": "Route Point",
|
||||||
"save": "Save",
|
"save": "Save",
|
||||||
"save-list": "Save List",
|
"save-list": "Save List",
|
||||||
"save-trail": "Save Trail",
|
"save-trail": "Save Trail",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
"removed-trail-from": "Ruta borrada de",
|
"removed-trail-from": "Ruta borrada de",
|
||||||
"required": "Obligatorio",
|
"required": "Obligatorio",
|
||||||
"reset-password": "Restablecer Contraseña",
|
"reset-password": "Restablecer Contraseña",
|
||||||
|
"route-point": "",
|
||||||
"save": "Guardar",
|
"save": "Guardar",
|
||||||
"save-list": "Guardar Lista",
|
"save-list": "Guardar Lista",
|
||||||
"save-trail": "Guardar Ruta",
|
"save-trail": "Guardar Ruta",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
"removed-trail-from": "Enlever l'itinéraire de",
|
"removed-trail-from": "Enlever l'itinéraire de",
|
||||||
"required": "Requis",
|
"required": "Requis",
|
||||||
"reset-password": "Réinitialiser le mot de passe",
|
"reset-password": "Réinitialiser le mot de passe",
|
||||||
|
"route-point": "",
|
||||||
"save": "Sauvegarder",
|
"save": "Sauvegarder",
|
||||||
"save-list": "Sauvegarder la liste",
|
"save-list": "Sauvegarder la liste",
|
||||||
"save-trail": "Sauvegarder l'itinéraire",
|
"save-trail": "Sauvegarder l'itinéraire",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
"removed-trail-from": "Eltávolított nyomvonal a",
|
"removed-trail-from": "Eltávolított nyomvonal a",
|
||||||
"required": "Kötelező",
|
"required": "Kötelező",
|
||||||
"reset-password": "Reset Password",
|
"reset-password": "Reset Password",
|
||||||
|
"route-point": "",
|
||||||
"save": "Mentés",
|
"save": "Mentés",
|
||||||
"save-list": "Save List",
|
"save-list": "Save List",
|
||||||
"save-trail": "Útvonal mentése",
|
"save-trail": "Útvonal mentése",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
"removed-trail-from": "Percorso rimosso da",
|
"removed-trail-from": "Percorso rimosso da",
|
||||||
"required": "Obbligatorio",
|
"required": "Obbligatorio",
|
||||||
"reset-password": "Ripristinare Password",
|
"reset-password": "Ripristinare Password",
|
||||||
|
"route-point": "",
|
||||||
"save": "Salva",
|
"save": "Salva",
|
||||||
"save-list": "Salta Lista",
|
"save-list": "Salta Lista",
|
||||||
"save-trail": "Salva percorso",
|
"save-trail": "Salva percorso",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
"removed-trail-from": "De wandelroute is verwijderd van",
|
"removed-trail-from": "De wandelroute is verwijderd van",
|
||||||
"required": "Verplicht",
|
"required": "Verplicht",
|
||||||
"reset-password": "Reset Password",
|
"reset-password": "Reset Password",
|
||||||
|
"route-point": "",
|
||||||
"save": "Bewaren",
|
"save": "Bewaren",
|
||||||
"save-list": "Save List",
|
"save-list": "Save List",
|
||||||
"save-trail": "Wandelroute bewaren",
|
"save-trail": "Wandelroute bewaren",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
"removed-trail-from": "Usunięto szlak z",
|
"removed-trail-from": "Usunięto szlak z",
|
||||||
"required": "Wymagane",
|
"required": "Wymagane",
|
||||||
"reset-password": "Resetuj hasło",
|
"reset-password": "Resetuj hasło",
|
||||||
|
"route-point": "",
|
||||||
"save": "Zapisz",
|
"save": "Zapisz",
|
||||||
"save-list": "Zapisz listę",
|
"save-list": "Zapisz listę",
|
||||||
"save-trail": "Zapisz szlak",
|
"save-trail": "Zapisz szlak",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
"removed-trail-from": "Trilha removida de",
|
"removed-trail-from": "Trilha removida de",
|
||||||
"required": "Obrigatório",
|
"required": "Obrigatório",
|
||||||
"reset-password": "Reset Password",
|
"reset-password": "Reset Password",
|
||||||
|
"route-point": "",
|
||||||
"save": "Guardar",
|
"save": "Guardar",
|
||||||
"save-list": "Gravar lista",
|
"save-list": "Gravar lista",
|
||||||
"save-trail": "Guardar trilho",
|
"save-trail": "Guardar trilho",
|
||||||
|
|||||||
@@ -222,6 +222,7 @@
|
|||||||
"removed-trail-from": "路线已删除自",
|
"removed-trail-from": "路线已删除自",
|
||||||
"required": "必填",
|
"required": "必填",
|
||||||
"reset-password": "重置密码",
|
"reset-password": "重置密码",
|
||||||
|
"route-point": "",
|
||||||
"save": "保存",
|
"save": "保存",
|
||||||
"save-list": "保存列表",
|
"save-list": "保存列表",
|
||||||
"save-trail": "保存路线",
|
"save-trail": "保存路线",
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export function createMarkerFromWaypoint(waypoint: Waypoint, onDragEnd?: (marker
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const popup = new M.Popup({ offset: 25, closeButton: false }).setDOMContent(
|
const popup = new M.Popup({ offset: 25 }).setDOMContent(
|
||||||
content
|
content
|
||||||
);
|
);
|
||||||
marker
|
marker
|
||||||
@@ -86,12 +86,27 @@ export function createAnchorMarker(lat: number, lon: number, index: number,
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
marker.setLngLat([lon, lat]);
|
marker.setLngLat([lon, lat]);
|
||||||
|
const popup = new M.Popup()
|
||||||
|
|
||||||
|
const popupContent = document.createElement("div");
|
||||||
|
const anchorH = document.createElement("h5")
|
||||||
|
anchorH.classList.add("text-base", "font-medium");
|
||||||
|
anchorH.textContent = get(_)("route-point") + " #" + index;
|
||||||
|
|
||||||
const deleteButton = document.createElement("button");
|
const deleteButton = document.createElement("button");
|
||||||
deleteButton.className = "fa fa-trash text-red-500 rounded-full aspect-square h-8 text-lg";
|
deleteButton.className = "btn-secondary w-full mt-2 text-sm";
|
||||||
|
const deleteButtonIcon = document.createElement("i")
|
||||||
|
deleteButtonIcon.classList.add("fa", "fa-trash", "mr-2")
|
||||||
|
deleteButton.appendChild(deleteButtonIcon)
|
||||||
|
const deleteButtonText = document.createElement("span")
|
||||||
|
deleteButtonText.textContent = get(_)("delete")
|
||||||
|
deleteButton.appendChild(deleteButtonIcon)
|
||||||
|
deleteButton.appendChild(deleteButtonText)
|
||||||
deleteButton.addEventListener("click", onDeleteClick)
|
deleteButton.addEventListener("click", onDeleteClick)
|
||||||
const popup = new M.Popup({ closeButton: false })
|
|
||||||
popup.setDOMContent(deleteButton)
|
popupContent.appendChild(anchorH)
|
||||||
|
popupContent.appendChild(deleteButton)
|
||||||
|
popup.setDOMContent(popupContent)
|
||||||
marker.setPopup(popup);
|
marker.setPopup(popup);
|
||||||
|
|
||||||
marker.on("dragstart", onDragStart);
|
marker.on("dragstart", onDragStart);
|
||||||
@@ -111,7 +126,7 @@ export function createPopupFromTrail(trail: Trail) {
|
|||||||
: get(theme) === "light"
|
: get(theme) === "light"
|
||||||
? emptyStateTrailLight
|
? emptyStateTrailLight
|
||||||
: emptyStateTrailDark;
|
: emptyStateTrailDark;
|
||||||
const popup = new M.Popup({ maxWidth: "320px", closeButton: false });
|
const popup = new M.Popup({ maxWidth: "320px" });
|
||||||
// Create a container element for the popup content
|
// Create a container element for the popup content
|
||||||
const linkElement = document.createElement("a");
|
const linkElement = document.createElement("a");
|
||||||
linkElement.href = `/map/trail/${trail.id}`; // Set href safely
|
linkElement.href = `/map/trail/${trail.id}`; // Set href safely
|
||||||
|
|||||||
@@ -619,7 +619,7 @@ export class ElevationProfile {
|
|||||||
tooltipInfo.push(
|
tooltipInfo.push(
|
||||||
`After: ${this.cumulatedDistanceAdjustedUnit[
|
`After: ${this.cumulatedDistanceAdjustedUnit[
|
||||||
tooltipItem.dataIndex
|
tooltipItem.dataIndex
|
||||||
].toFixed(4)} ${distanceUnit} ${this.cumulatedTime.length ? '(' + formatTimeHHMM(this.cumulatedTime[tooltipItem.dataIndex]) + ')' : ''}`
|
].toFixed(2)} ${distanceUnit} ${this.cumulatedTime.length ? '(' + formatTimeHHMM(this.cumulatedTime[tooltipItem.dataIndex]) + ')' : ''}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -138,6 +138,7 @@
|
|||||||
|
|
||||||
function selectTrail(trail: Trail) {
|
function selectTrail(trail: Trail) {
|
||||||
selectedTrail = trail;
|
selectedTrail = trail;
|
||||||
|
mapWithElevation.unHighlightTrail(trail.id!);
|
||||||
window.scrollTo({ top: 0 });
|
window.scrollTo({ top: 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
const file = files[i];
|
const file = files[i];
|
||||||
try {
|
try {
|
||||||
uploadProgress.set((progress += 100 / (files.length * 2)));
|
uploadProgress.set((progress += 100 / (files.length * 2)));
|
||||||
// await trails_upload(file);
|
await trails_upload(file);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
errorsThrown += 1;
|
errorsThrown += 1;
|
||||||
show_toast({
|
show_toast({
|
||||||
|
|||||||
@@ -644,7 +644,9 @@
|
|||||||
}
|
}
|
||||||
if (anchorIndex == 0) {
|
if (anchorIndex == 0) {
|
||||||
deleteFromRoute(anchorIndex);
|
deleteFromRoute(anchorIndex);
|
||||||
updateTrailWithRouteData();
|
if ($formData.expand?.gpx_data) {
|
||||||
|
updateTrailWithRouteData();
|
||||||
|
}
|
||||||
} else if (anchorIndex == anchors.length) {
|
} else if (anchorIndex == anchors.length) {
|
||||||
deleteFromRoute(anchorIndex - 1);
|
deleteFromRoute(anchorIndex - 1);
|
||||||
updateTrailWithRouteData();
|
updateTrailWithRouteData();
|
||||||
@@ -694,8 +696,9 @@
|
|||||||
if (previousRouteSegment) {
|
if (previousRouteSegment) {
|
||||||
editRoute(anchorIndex - 1, previousRouteSegment);
|
editRoute(anchorIndex - 1, previousRouteSegment);
|
||||||
}
|
}
|
||||||
|
if ($formData.expand?.gpx_data) {
|
||||||
updateTrailWithRouteData();
|
updateTrailWithRouteData();
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
show_toast({
|
show_toast({
|
||||||
@@ -775,6 +778,7 @@
|
|||||||
$formData.elevation_gain = totals.elevationGain;
|
$formData.elevation_gain = totals.elevationGain;
|
||||||
$formData.elevation_loss = totals.elevationLoss;
|
$formData.elevation_loss = totals.elevationLoss;
|
||||||
$formData.expand!.gpx_data = route.toString();
|
$formData.expand!.gpx_data = route.toString();
|
||||||
|
|
||||||
if (!$formData.id) {
|
if (!$formData.id) {
|
||||||
$formData.id = cryptoRandomString({ length: 15 });
|
$formData.id = cryptoRandomString({ length: 15 });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user