import { DecodedTile , DecoderOptions , ITileDecoder , OptionsMap , TileInfo } from "@here/harp-datasource-protocol" ; import { StyleSetEvaluator , StyleSetOptions } from "@here/harp-datasource-protocol/index-decoder" ; import { Projection , TileKey } from "@here/harp-geoutils" ; import { LoggerManager } from "@here/harp-utils" ; const logger = LoggerManager . instance . create ( "ThemedTileDecoder" ) ; /**
 * `ThemedTileDecoder` implements an [[ITileDecoder]] which uses a [[Theme]] to apply styles to the
 * objects displayed in the map.
 *
 * By default, decoders are executed in web workers (using [[TileDecoderService]]) for performance
 * reasons.
 */ export abstract class ThemedTileDecoder implements ITileDecoder { languages ? : string [ ] ; m_storageLevelOffset : number = 0 ; protected m_styleSetEvaluator ? : StyleSetEvaluator ; abstract connect ( ) ; dispose ( ) { } decodeTile ( data , tileKey , projection ) { if ( this . m_styleSetEvaluator === undefined ) { logger . info ( "cannot decode tile, as there is not style available" ) ; return Promise . resolve ( undefined ) ; } return this . decodeThemedTile ( data , tileKey , this . m_styleSetEvaluator , projection ) ; } getTileInfo ( data , tileKey , projection ) { return Promise . resolve ( undefined ) ; } configure ( options ? , customOptions ? ) { if ( options ?. styleSet !== undefined ) { this . m_styleSetEvaluator = new StyleSetEvaluator ( options as StyleSetOptions ) ; } if ( options ?. languages !== undefined ) { this . languages = options . languages ; } if ( customOptions !== undefined && customOptions . storageLevelOffset !== undefined ) { this . m_storageLevelOffset = customOptions . storageLevelOffset ; } } param data param tileKey param styleSetEvaluator param projection abstract decodeThemedTile ( data , tileKey , styleSetEvaluator , projection ) ; }