import type { Map as MbMap } from '@kbn/mapbox-gl' ; import { StaticStyleProperty } from './static_style_property' ; import { VECTOR_STYLES } from '../../../../../common/constants' ; import { HALF_MAKI_ICON_SIZE , } from '../symbol_utils' ; import { SizeStaticOptions } from '../../../../../common/descriptor_types' ; export class StaticSizeProperty extends StaticStyleProperty < SizeStaticOptions > { constructor ( options , styleName ) { if ( typeof options . size !== 'number' ) { super ( { size : 1 } , styleName ) ; } else { super ( options , styleName ) ; } } syncHaloWidthWithMb ( mbLayerId , mbMap ) { mbMap . setPaintProperty ( mbLayerId , 'icon-halo-width' , this . _options . size ) ; } syncIconSizeWithMb ( symbolLayerId , mbMap ) { mbMap . setLayoutProperty ( symbolLayerId , 'icon-size' , this . _options . size / HALF_MAKI_ICON_SIZE ) ; } syncCircleStrokeWidthWithMb ( mbLayerId , mbMap , hasNoRadius ) { if ( hasNoRadius ) { mbMap . setPaintProperty ( mbLayerId , 'circle-stroke-width' , 0 ) ; } else { mbMap . setPaintProperty ( mbLayerId , 'circle-stroke-width' , this . _options . size ) ; } } syncCircleRadiusWithMb ( mbLayerId , mbMap ) { mbMap . setPaintProperty ( mbLayerId , 'circle-radius' , this . _options . size ) ; } syncLineWidthWithMb ( mbLayerId , mbMap ) { mbMap . setPaintProperty ( mbLayerId , 'line-width' , this . _options . size ) ; } syncLabelSizeWithMb ( mbLayerId , mbMap ) { mbMap . setLayoutProperty ( mbLayerId , 'text-size' , this . _options . size ) ; } }