diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-models.ts index 1c198825df..b730f1df20 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/map-models.ts @@ -26,7 +26,7 @@ import { export type GenericFunction = (data: FormattedData, dsData: FormattedData[], dsIndex: number) => string; export type MarkerImageFunction = (data: FormattedData, dsData: FormattedData[], dsIndex: number) => string; -export type GetTooltip= (point: FormattedData, setTooltip?: boolean) => string; +export type GetTooltip = (point: FormattedData, setTooltip?: boolean) => string; export type MapSettings = { draggableMarker: boolean; @@ -164,9 +164,23 @@ export interface HistorySelectSettings { } export type TripAnimationSettings = { + showPoints: boolean; pointColor: string; pointSize: number; pointTooltipOnRightPanel: boolean; + usePointAsAnchor: boolean; + normalizationStep: number; + showPolygon: boolean; + latKeyName: string; + lngKeyName: string; + rotationAngle: number; + label: string; + tooltipPattern: string; + useTooltipFunction :boolean; + useLabelFunction:boolean; + pointAsAnchorFunction: GenericFunction; + tooltipFunction: GenericFunction; + labelFunction: GenericFunction; } export type actionsHandler = ($event: Event, datasource: Datasource) => void; diff --git a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts b/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts index 7725ded57e..c8afaee548 100644 --- a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts @@ -19,7 +19,7 @@ import tinycolor from 'tinycolor2'; import { AfterViewInit, ChangeDetectorRef, Component, Input, OnInit, SecurityContext, ViewChild } from '@angular/core'; import { MapWidgetController, TbMapWidgetV2 } from '../lib/maps/map-widget2'; -import { FormattedData, MapProviders } from '../lib/maps/map-models'; +import { FormattedData, MapProviders, TripAnimationSettings } from '../lib/maps/map-models'; import { addCondition, addGroupInfo, addToSchema, initSchema } from '@app/core/schema-utils'; import { mapPolygonSchema, pathSchema, pointSchema, tripAnimationSchema } from '../lib/maps/schemes'; import { DomSanitizer } from '@angular/platform-browser'; @@ -57,7 +57,7 @@ export class TripAnimationComponent implements OnInit, AfterViewInit { normalizationStep: number; interpolatedTimeData = []; widgetConfig: WidgetConfig; - settings; + settings: TripAnimationSettings; mainTooltip = ''; visibleTooltip = false; activeTrip: FormattedData; @@ -178,7 +178,7 @@ export class TripAnimationComponent implements OnInit, AfterViewInit { calcTooltip = (point?: FormattedData) => { const data = point ? point : this.activeTrip; const tooltipPattern: string = this.settings.useTooltipFunction ? - safeExecute(this.settings.tooolTipFunction, [data, this.historicalData, point.dsIndex]) : this.settings.tooltipPattern; + safeExecute(this.settings.tooltipFunction, [data, this.historicalData, point.dsIndex]) : this.settings.tooltipPattern; const tooltipText = parseWithTranslation.parseTemplate(tooltipPattern, data, true); this.mainTooltip = this.sanitizer.sanitize( SecurityContext.HTML, tooltipText);