add some types
This commit is contained in:
parent
4aa10db7a3
commit
448fb2fd4f
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user