diff --git a/src/client/src/api/ApiStore/store.ts b/src/client/src/api/ApiStore/store.ts
index 91129bd..c04bcae 100644
--- a/src/client/src/api/ApiStore/store.ts
+++ b/src/client/src/api/ApiStore/store.ts
@@ -23,6 +23,7 @@ import {
} from "./types";
// @ts-ignore
import { orderStationsByRoute } from "../../utils/routeStationsUtils";
+import { resamplePath } from "../../utils/animationUtils";
class ApiStore {
isLoading = true;
@@ -88,7 +89,26 @@ class ApiStore {
};
getRoute = async () => {
- this.route = await getRoute(this.routeId!);
+ const route = await getRoute(this.routeId!);
+ if (route.path && route.path.length > 1) {
+ // Рассчитываем общую дистанцию для выбора адекватного шага ресемплинга
+ let totalDist = 0;
+ for (let i = 0; i < route.path.length - 1; i++) {
+ const p1 = route.path[i];
+ const p2 = route.path[i + 1];
+ totalDist += Math.sqrt(
+ Math.pow(p2[0] - p1[0], 2) + Math.pow(p2[1] - p1[1], 2)
+ );
+ }
+ // Хотим иметь примерно 2000 точек для равномерности и плавности
+ const segmentLength = totalDist / 2000;
+ if (segmentLength > 0) {
+ route.path = resamplePath(route.path as [number, number][], segmentLength);
+ }
+ }
+ runInAction(() => {
+ this.route = route;
+ });
this.updateOrderedRouteStations();
};
diff --git a/src/client/src/components/ListOfSights/SightFrame.jsx b/src/client/src/components/ListOfSights/SightFrame.jsx
index c65b0f5..7a42aa2 100644
--- a/src/client/src/components/ListOfSights/SightFrame.jsx
+++ b/src/client/src/components/ListOfSights/SightFrame.jsx
@@ -428,6 +428,16 @@ const SightFrame = observer(({ media, sight_id, sight_name }) => {
const processedSightName = useMemo(() => {
if (!sight_name) return sight_name;
+ // Handle \n line breaks (только в правом виджете)
+ if (sight_name.includes("\n")) {
+ return sight_name.split("\n").map((line, i) => (
+
}
+ {line}
+