|
|
|
@ -24,6 +24,7 @@ import { WidgetContext } from '@home/models/widget-component.models'; |
|
|
|
import { DataSet, DatasourceType, widgetType } from '@shared/models/widget.models'; |
|
|
|
import { DataKeyType } from '@shared/models/telemetry/telemetry.models'; |
|
|
|
import { WidgetSubscriptionOptions } from '@core/api/widget-api.models'; |
|
|
|
import { isDefinedAndNotNull } from '@core/utils'; |
|
|
|
|
|
|
|
const maxZoom = 4;// ?
|
|
|
|
|
|
|
|
@ -209,11 +210,15 @@ export class ImageMap extends LeafletMap { |
|
|
|
} |
|
|
|
|
|
|
|
convertPosition(expression): L.LatLng { |
|
|
|
if (isNaN(expression[this.options.xPosKeyName]) || isNaN(expression[this.options.yPosKeyName])) return null; |
|
|
|
Object.assign(expression, this.posFunction(expression[this.options.xPosKeyName], expression[this.options.yPosKeyName])); |
|
|
|
return this.pointToLatLng( |
|
|
|
expression.x * this.width, |
|
|
|
expression.y * this.height); |
|
|
|
const xPos = expression[this.options.xPosKeyName]; |
|
|
|
const yPos = expression[this.options.yPosKeyName]; |
|
|
|
if (!isDefinedAndNotNull(xPos) || isNaN(xPos) || !isDefinedAndNotNull(yPos) || isNaN(yPos)) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
Object.assign(expression, this.posFunction(xPos, yPos)); |
|
|
|
return this.pointToLatLng( |
|
|
|
expression.x * this.width, |
|
|
|
expression.y * this.height); |
|
|
|
} |
|
|
|
|
|
|
|
convertPositionPolygon(expression: Array<[number, number]>): L.LatLngExpression[] { |
|
|
|
|