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

# Interface StylePropertyMapReadOnly

The **`StylePropertyMapReadOnly`** interface of the CSS Typed Object Model API provides a read-only representation of a CSS declaration block that is an alternative to CSSStyleDeclaration. Retrieve an instance of this interface using Element.computedStyleMap().

[MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly)

interface StylePropertyMapReadOnly {  
    [size](#size): number;  
    ["\[iterator\]"](#iterator-1)(): [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<  
        \[string, [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/), any, any\>\],  
    \>;  
    [entries](#entries-1)(): [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<  
        \[string, [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/), any, any\>\],  
    \>;  
    [forEach](#foreach-1)(  
        callbackfn: (  
            value: [CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/)\[\],  
            key: string,  
            parent: StylePropertyMapReadOnly,  
        ) \=> void,  
        thisArg?: any,  
    ): void;  
    [get](#get-1)(property: string): [CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/) | undefined;  
    [getAll](#getall-1)(property: string): [CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/)\[\];  
    [has](#has-1)(property: string): boolean;  
    [keys](#keys-1)(): [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<string\>;  
    [values](#values-1)(): [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<  
        [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/), any, any\>,  
    \>;  
}

#### Hierarchy ([View Summary](https://docs.maptiler.com/sdk-js/api-reference/hierarchy/#Externals.StylePropertyMapReadOnly))

-   StylePropertyMapReadOnly
    -   [StylePropertyMap](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMap/)

##### Index

### Properties[](#properties)

[size](#size)

### Methods[](#methods)

[\[iterator\]](#iterator) [entries](#entries) [forEach](#foreach) [get](#get) [getAll](#getall) [has](#has) [keys](#keys) [values](#values)

## Properties[](#properties-1)

### `Readonly`size[](#size)

size: number

The **`size`** read-only property of the StylePropertyMapReadOnly interface returns an unsigned long integer containing the size of the StylePropertyMapReadOnly object.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/size)

## Methods[](#methods-1)

### \[iterator\][](#iterator)

-   "\[iterator\]"(): [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<  
        \[string, [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/), any, any\>\],  
    \>[](#iterator-1)
    
    #### Returns [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<\[string, [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/), any, any\>\]\>
    

### entries[](#entries)

-   entries(): [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<  
        \[string, [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/), any, any\>\],  
    \>[](#entries-1)
    
    #### Returns [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<\[string, [Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/), any, any\>\]\>
    

### forEach[](#foreach)

-   forEach(  
        callbackfn: (  
            value: [CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/)\[\],  
            key: string,  
            parent: StylePropertyMapReadOnly,  
        ) \=> void,  
        thisArg?: any,  
    ): void[](#foreach-1)
    
    #### Parameters
    
    -   callbackfn: (value: [CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/)\[\], key: string, parent: StylePropertyMapReadOnly) \=> void
    -   `Optional`thisArg: any
    
    #### Returns void
    

### get[](#get)

-   get(property: string): [CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/) | undefined[](#get-1)
    
    The **`get()`** method of the StylePropertyMapReadOnly interface returns a CSSStyleValue object for the first value of the specified property.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/get)
    
    #### Parameters
    
    -   property: string
    
    #### Returns [CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/) | undefined
    

### getAll[](#getall)

-   getAll(property: string): [CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/)\[\][](#getall-1)
    
    The **`getAll()`** method of the StylePropertyMapReadOnly interface returns an array of CSSStyleValue objects containing the values for the provided property.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/getAll)
    
    #### Parameters
    
    -   property: string
    
    #### Returns [CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/)\[\]
    

### has[](#has)

-   has(property: string): boolean[](#has-1)
    
    The **`has()`** method of the StylePropertyMapReadOnly interface indicates whether the specified property is in the StylePropertyMapReadOnly object.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/StylePropertyMapReadOnly/has)
    
    #### Parameters
    
    -   property: string
    
    #### Returns boolean
    

### keys[](#keys)

-   keys(): [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<string\>[](#keys-1)
    
    #### Returns [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<string\>
    

### values[](#values)

-   values(): [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<[Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/), any, any\>\>[](#values-1)
    
    #### Returns [StylePropertyMapReadOnlyIterator](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.StylePropertyMapReadOnlyIterator/)<[Iterable](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.Iterable/)<[CSSStyleValue](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.CSSStyleValue/), any, any\>\>
