---
title: "StyleExpression | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Class StyleExpression

##### Index

### Constructors[](#constructors)

[constructor](#constructor)

### Properties[](#properties)

[expression](#expression)

### Methods[](#methods)

[evaluate](#evaluate) [evaluateWithoutErrorHandling](#evaluatewithouterrorhandling)

## Constructors[](#constructors-1)

### constructor[](#constructor)

-   new StyleExpression(  
        expression: [Expression](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Expression/),  
        propertySpec?: [StylePropertySpecification](https://docs.maptiler.com/sdk-js/api-reference/types/StylePropertySpecification/) | null,  
        globalState?: [Record](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Record/)<string, any\>,  
    ): StyleExpression[](#constructorstyleexpression)
    
    #### Parameters
    
    -   expression: [Expression](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Expression/)
    -   `Optional`propertySpec: [StylePropertySpecification](https://docs.maptiler.com/sdk-js/api-reference/types/StylePropertySpecification/) | null
    -   `Optional`globalState: [Record](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Record/)<string, any\>
    
    #### Returns StyleExpression
    

## Properties[](#properties-1)

### expression[](#expression)

expression: [Expression](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Expression/)

## Methods[](#methods-1)

### evaluate[](#evaluate)

-   evaluate(  
        globals: [GlobalProperties](https://docs.maptiler.com/sdk-js/api-reference/types/GlobalProperties/),  
        feature?: [Feature](https://docs.maptiler.com/sdk-js/api-reference/types/Feature/),  
        featureState?: [FeatureState](https://docs.maptiler.com/sdk-js/api-reference/types/FeatureState/),  
        canonical?: [ICanonicalTileID](https://docs.maptiler.com/sdk-js/api-reference/interfaces/ICanonicalTileID/),  
        availableImages?: string\[\],  
        formattedSection?: [FormattedSection](https://docs.maptiler.com/sdk-js/api-reference/classes/FormattedSection/),  
    ): any[](#evaluate-1)
    
    #### Parameters
    
    -   globals: [GlobalProperties](https://docs.maptiler.com/sdk-js/api-reference/types/GlobalProperties/)
    -   `Optional`feature: [Feature](https://docs.maptiler.com/sdk-js/api-reference/types/Feature/)
    -   `Optional`featureState: [FeatureState](https://docs.maptiler.com/sdk-js/api-reference/types/FeatureState/)
    -   `Optional`canonical: [ICanonicalTileID](https://docs.maptiler.com/sdk-js/api-reference/interfaces/ICanonicalTileID/)
    -   `Optional`availableImages: string\[\]
    -   `Optional`formattedSection: [FormattedSection](https://docs.maptiler.com/sdk-js/api-reference/classes/FormattedSection/)
    
    #### Returns any
    

### evaluateWithoutErrorHandling[](#evaluatewithouterrorhandling)

-   evaluateWithoutErrorHandling(  
        globals: [GlobalProperties](https://docs.maptiler.com/sdk-js/api-reference/types/GlobalProperties/),  
        feature?: [Feature](https://docs.maptiler.com/sdk-js/api-reference/types/Feature/),  
        featureState?: [FeatureState](https://docs.maptiler.com/sdk-js/api-reference/types/FeatureState/),  
        canonical?: [ICanonicalTileID](https://docs.maptiler.com/sdk-js/api-reference/interfaces/ICanonicalTileID/),  
        availableImages?: string\[\],  
        formattedSection?: [FormattedSection](https://docs.maptiler.com/sdk-js/api-reference/classes/FormattedSection/),  
    ): any[](#evaluatewithouterrorhandling-1)
    
    #### Parameters
    
    -   globals: [GlobalProperties](https://docs.maptiler.com/sdk-js/api-reference/types/GlobalProperties/)
    -   `Optional`feature: [Feature](https://docs.maptiler.com/sdk-js/api-reference/types/Feature/)
    -   `Optional`featureState: [FeatureState](https://docs.maptiler.com/sdk-js/api-reference/types/FeatureState/)
    -   `Optional`canonical: [ICanonicalTileID](https://docs.maptiler.com/sdk-js/api-reference/interfaces/ICanonicalTileID/)
    -   `Optional`availableImages: string\[\]
    -   `Optional`formattedSection: [FormattedSection](https://docs.maptiler.com/sdk-js/api-reference/classes/FormattedSection/)
    
    #### Returns any
