import type { Map as MbMap } from '@kbn/mapbox-gl' ; import { DynamicStyleProperty , getNumericalMbFeatureStateValue } from './dynamic_style_property' ; import { OrientationDynamicOptions } from '../../../../../common/descriptor_types' ; import { RawValue } from '../../../../../common/constants' ; export class DynamicOrientationProperty extends DynamicStyleProperty < OrientationDynamicOptions > { syncIconRotationWithMb ( symbolLayerId , mbMap ) { if ( this . _field && this . _field . isValid ( ) ) { const targetName = this . getMbPropertyName ( ) ; mbMap . setLayoutProperty ( symbolLayerId , 'icon-rotate' , [ 'coalesce' , [ this . getMbLookupFunction ( ) , targetName ] , 0 , ] ) ; } else { mbMap . setLayoutProperty ( symbolLayerId , 'icon-rotate' , 0 ) ; } } supportsFieldMeta ( ) { return false ; } supportsMbFeatureState ( ) { return false ; } getMbPropertyValue ( rawValue ) { return getNumericalMbFeatureStateValue ( rawValue ) ; } }