---
title: "StaticMapBaseOptions | Client js | Api client"
description: "Documentation for MapTiler Client"
---

> 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.

# Type Alias StaticMapBaseOptions

Base set of options that can be provided to all the types of static maps

type StaticMapBaseOptions \= {  
    [apiKey](#apikey)?: string;  
    [attribution](#attribution)?: "bottomright" | "bottomleft" | "topleft" | "topright" | false;  
    [format](#format)?: "png" | "jpg" | "webp";  
    [height](#height)?: number;  
    [hiDPI](#hidpi)?: boolean;  
    [markerAnchor](#markeranchor)?:  
        | "top"  
        | "left"  
        | "bottom"  
        | "right"  
        | "center"  
        | "topleft"  
        | "bottomleft"  
        | "topright"  
        | "bottomright";  
    [markerIcon](#markericon)?: string;  
    [markers](#markers)?: [StaticMapMarker](https://docs.maptiler.com/client-js/api/types/services_staticMaps.StaticMapMarker/)  
    | [StaticMapMarker](https://docs.maptiler.com/client-js/api/types/services_staticMaps.StaticMapMarker/)\[\];  
    [path](#path)?: Position\[\];  
    [pathFillColor](#pathfillcolor)?: string;  
    [pathStrokeColor](#pathstrokecolor)?: string;  
    [pathWidth](#pathwidth)?: number;  
    [style](#style)?: string | [ReferenceMapStyle](https://docs.maptiler.com/client-js/api/classes/index.ReferenceMapStyle/) | [MapStyleVariant](https://docs.maptiler.com/client-js/api/classes/index.MapStyleVariant/);  
    [width](#width)?: number;  
}

-   Defined in [services/staticMaps.ts:9](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L9)

##### Index

### Properties

[apiKey?](#apikey) [attribution?](#attribution) [format?](#format) [height?](#height) [hiDPI?](#hidpi) [markerAnchor?](#markeranchor) [markerIcon?](#markericon) [markers?](#markers) [path?](#path) [pathFillColor?](#pathfillcolor) [pathStrokeColor?](#pathstrokecolor) [pathWidth?](#pathwidth) [style?](#style) [width?](#width)

## Properties

### `Optional`apiKey[](#apikey)

apiKey?: string

Custom MapTiler Cloud API key to use instead of the one in global `config`

-   Defined in [services/staticMaps.ts:13](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L13)

### `Optional`attribution[](#attribution)

attribution?: "bottomright" | "bottomleft" | "topleft" | "topright" | false

Placement of the attribution. Can also be set to `false` to not show attribution. Default: `"bottomright"`

-   Defined in [services/staticMaps.ts:49](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L49)

### `Optional`format[](#format)

format?: "png" | "jpg" | "webp"

Image format. Default: `"png"`

-   Defined in [services/staticMaps.ts:31](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L31)

### `Optional`height[](#height)

height?: number

Height of the output image. Maximum value: `2048`. Default: `1024`

-   Defined in [services/staticMaps.ts:43](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L43)

### `Optional`hiDPI[](#hidpi)

hiDPI?: boolean

Double the size of the static map image to support hiDPI/Retina monitors. Default: `false`

-   Defined in [services/staticMaps.ts:25](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L25)

### `Optional`markerAnchor[](#markeranchor)

markerAnchor?:  
    | "top"  
    | "left"  
    | "bottom"  
    | "right"  
    | "center"  
    | "topleft"  
    | "bottomleft"  
    | "topright"  
    | "bottomright"

Position of the marker regarding its coordinates. Applies only:

-   with a custom icon provided with `markerIcon`
-   if one or multiple markers positions are provided. Default: `"bottom"`

-   Defined in [services/staticMaps.ts:69](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L69)

### `Optional`markerIcon[](#markericon)

markerIcon?: string

URL of the marker image. Applies only if one or multiple markers positions are provided. Default: none provided

-   Defined in [services/staticMaps.ts:61](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L61)

### `Optional`markers[](#markers)

markers?: [StaticMapMarker](https://docs.maptiler.com/client-js/api/types/services_staticMaps.StaticMapMarker/) | [StaticMapMarker](https://docs.maptiler.com/client-js/api/types/services_staticMaps.StaticMapMarker/)\[\]

A marker or list of markers to show on the map Default: none provided

-   Defined in [services/staticMaps.ts:55](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L55)

### `Optional`path[](#path)

path?: Position\[\]

Draw a path or polygon on top of the map. If the path is too long it will be simplified, yet remaining accurate. Default: none provided

-   Defined in [services/staticMaps.ts:84](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L84)

### `Optional`pathFillColor[](#pathfillcolor)

pathFillColor?: string

Color of the filling, also works if the polygon is not closed. The color must be CSS compatible. Examples:

-   long form hex without transparency `"#FF0000"` (red)
-   short form hex without transparency `"#F00"` (red)
-   long form hex with transparency `"#FF000008"` (red, half opacity)
-   short form hex with transparency `"#F008"` (red, half opacity)
-   CSS color shorthands: `"red"`, `"chartreuse"`, etc.
-   decimal RGB values without transparency: `"rgb(128, 100, 255)"`
-   decimal RGB values with transparency: `"rgb(128, 100, 255, 0.5)"` Default: none (transparent filling)

-   Defined in [services/staticMaps.ts:112](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L112)

### `Optional`pathStrokeColor[](#pathstrokecolor)

pathStrokeColor?: string

Color of the path line. The color must be CSS compatible. Examples:

-   long form hex without transparency `"#FF0000"` (red)
-   short form hex without transparency `"#F00"` (red)
-   long form hex with transparency `"#FF000008"` (red, half opacity)
-   short form hex with transparency `"#F008"` (red, half opacity)
-   CSS color shorthands: `"red"`, `"chartreuse"`, etc.
-   decimal RGB values without transparency: `"rgb(128, 100, 255)"`
-   decimal RGB values with transparency: `"rgb(128, 100, 255, 0.5)"` Default: `"blue"`

-   Defined in [services/staticMaps.ts:98](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L98)

### `Optional`pathWidth[](#pathwidth)

pathWidth?: number

Width of the path line in pixel. It can be floating point precision (ex: `0.5`) Default: `1` if `hiDPI` is `false` and `2` if `hiDPI` is `true`.

-   Defined in [services/staticMaps.ts:118](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L118)

### `Optional`style[](#style)

style?: string | [ReferenceMapStyle](https://docs.maptiler.com/client-js/api/classes/index.ReferenceMapStyle/) | [MapStyleVariant](https://docs.maptiler.com/client-js/api/classes/index.MapStyleVariant/)

Style of the map (not full style URL). Example: "winter", "streets-v2". Default: `"streets-v2"`

-   Defined in [services/staticMaps.ts:19](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L19)

### `Optional`width[](#width)

width?: number

Width of the output image. Maximum value: `2048`. Default: `1024`

-   Defined in [services/staticMaps.ts:37](https://github.com/maptiler/maptiler-client-js/blob/f88659ae276c959a754e4c0f3b5c2aae1f483caa/src/services/staticMaps.ts#L37)
