Commit 448fb2fd4fdd3374ab04e01dc3d2231af7422a45

Authored by Artem Halushko
1 parent 4aa10db7

add some types

... ... @@ -26,7 +26,7 @@ import {
26 26
27 27 export type GenericFunction = (data: FormattedData, dsData: FormattedData[], dsIndex: number) => string;
28 28 export type MarkerImageFunction = (data: FormattedData, dsData: FormattedData[], dsIndex: number) => string;
29   -export type GetTooltip= (point: FormattedData, setTooltip?: boolean) => string;
  29 +export type GetTooltip = (point: FormattedData, setTooltip?: boolean) => string;
30 30
31 31 export type MapSettings = {
32 32 draggableMarker: boolean;
... ... @@ -164,9 +164,23 @@ export interface HistorySelectSettings {
164 164 }
165 165
166 166 export type TripAnimationSettings = {
  167 + showPoints: boolean;
167 168 pointColor: string;
168 169 pointSize: number;
169 170 pointTooltipOnRightPanel: boolean;
  171 + usePointAsAnchor: boolean;
  172 + normalizationStep: number;
  173 + showPolygon: boolean;
  174 + latKeyName: string;
  175 + lngKeyName: string;
  176 + rotationAngle: number;
  177 + label: string;
  178 + tooltipPattern: string;
  179 + useTooltipFunction :boolean;
  180 + useLabelFunction:boolean;
  181 + pointAsAnchorFunction: GenericFunction;
  182 + tooltipFunction: GenericFunction;
  183 + labelFunction: GenericFunction;
170 184 }
171 185
172 186 export type actionsHandler = ($event: Event, datasource: Datasource) => void;
... ...
... ... @@ -19,7 +19,7 @@ import tinycolor from 'tinycolor2';
19 19
20 20 import { AfterViewInit, ChangeDetectorRef, Component, Input, OnInit, SecurityContext, ViewChild } from '@angular/core';
21 21 import { MapWidgetController, TbMapWidgetV2 } from '../lib/maps/map-widget2';
22   -import { FormattedData, MapProviders } from '../lib/maps/map-models';
  22 +import { FormattedData, MapProviders, TripAnimationSettings } from '../lib/maps/map-models';
23 23 import { addCondition, addGroupInfo, addToSchema, initSchema } from '@app/core/schema-utils';
24 24 import { mapPolygonSchema, pathSchema, pointSchema, tripAnimationSchema } from '../lib/maps/schemes';
25 25 import { DomSanitizer } from '@angular/platform-browser';
... ... @@ -57,7 +57,7 @@ export class TripAnimationComponent implements OnInit, AfterViewInit {
57 57 normalizationStep: number;
58 58 interpolatedTimeData = [];
59 59 widgetConfig: WidgetConfig;
60   - settings;
  60 + settings: TripAnimationSettings;
61 61 mainTooltip = '';
62 62 visibleTooltip = false;
63 63 activeTrip: FormattedData;
... ... @@ -178,7 +178,7 @@ export class TripAnimationComponent implements OnInit, AfterViewInit {
178 178 calcTooltip = (point?: FormattedData) => {
179 179 const data = point ? point : this.activeTrip;
180 180 const tooltipPattern: string = this.settings.useTooltipFunction ?
181   - safeExecute(this.settings.tooolTipFunction, [data, this.historicalData, point.dsIndex]) : this.settings.tooltipPattern;
  181 + safeExecute(this.settings.tooltipFunction, [data, this.historicalData, point.dsIndex]) : this.settings.tooltipPattern;
182 182 const tooltipText = parseWithTranslation.parseTemplate(tooltipPattern, data, true);
183 183 this.mainTooltip = this.sanitizer.sanitize(
184 184 SecurityContext.HTML, tooltipText);
... ...