---
title: "MapOptions | 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.

# Type Alias MapOptions

MapOptions: [Omit](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.Omit/)<[MapOptions](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.MapOptions/), "style" | "maplibreLogo" | "attributionControl"\> & {  
    apiKey?: string;  
    attributionControl?: [AttributionControlOptions](https://docs.maptiler.com/sdk-js/api-reference/interfaces/AttributionControlOptions/);  
    customAttribution?: string | string\[\];  
    customControls?: boolean | string;  
    forceNoAttributionControl?: boolean;  
    fullscreenControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/);  
    geolocate?: typeof [GeolocationType](https://docs.maptiler.com/sdk-js/api-reference/variables/GeolocationType/)\[keyof typeof [GeolocationType](https://docs.maptiler.com/sdk-js/api-reference/variables/GeolocationType/)\] | boolean;  
    geolocateControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/);  
    halo?: [RadialGradientLayerConstructorOptions](https://docs.maptiler.com/sdk-js/api-reference/types/RadialGradientLayerConstructorOptions/) | boolean;  
    language?: [LanguageInfo](https://docs.maptiler.com/sdk-js/api-reference/types/LanguageInfo/) | string;  
    logSDKVersion?: boolean;  
    maptilerLogo?: boolean;  
    minimap?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/) | [MinimapOptionsInput](https://docs.maptiler.com/sdk-js/api-reference/interfaces/MinimapOptionsInput/);  
    navigationControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/);  
    projection?: [ProjectionTypes](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionTypes/);  
    projectionControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/);  
    rtlTextPlugin?: boolean | string;  
    scaleControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/);  
    space?: [CubemapLayerConstructorOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CubemapLayerConstructorOptions/) | boolean;  
    style?: [ReferenceMapStyle](https://docs.maptiler.com/sdk-js/api-reference/classes/ReferenceMapStyle/) | [MapStyleVariant](https://docs.maptiler.com/sdk-js/api-reference/classes/MapStyleVariant/) | [StyleSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSpecification/) | string;  
    terrain?: boolean;  
    terrainControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/);  
    terrainExaggeration?: number;  
    useExperimentalTilePreloading?: boolean;  
}

Options to provide to the `Map` constructor

#### Type Declaration

-   ##### `Optional`apiKey?: string
    
    Define the MapTiler Cloud API key to be used. This is strictly equivalent to setting `config.apiKey` and will overwrite it.
    
-   ##### `Optional`attributionControl?: [AttributionControlOptions](https://docs.maptiler.com/sdk-js/api-reference/interfaces/AttributionControlOptions/)
    
    Options for an [AttributionControl](https://docs.maptiler.com/sdk-js/api-reference/classes/AttributionControl/).
    
-   ##### `Optional`customAttribution?: string | string\[\]
    
    Attributions to show in addition to any other attributions in an [AttributionControl](https://docs.maptiler.com/sdk-js/api-reference/classes/AttributionControl/).
    
-   ##### `Optional`customControls?: boolean | string
    
    Detect custom external controls. (default: `false`, will detect automatically if `true`)
    
-   ##### `Optional`forceNoAttributionControl?: boolean
    
    attributionControl
    
-   ##### `Optional`fullscreenControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/)
    
    Show the full screen control. (default: `false`, will show if `true`)
    
-   ##### `Optional`geolocate?: typeof [GeolocationType](https://docs.maptiler.com/sdk-js/api-reference/variables/GeolocationType/)\[keyof typeof [GeolocationType](https://docs.maptiler.com/sdk-js/api-reference/variables/GeolocationType/)\] | boolean
    
    Method to position the map at a given geolocation. Only if:
    
    -   `hash` is `false`
    -   `center` is not provided
    
    If the value is `true` of `"POINT"` (given by `GeolocationType.POINT`) then the positionning uses the MapTiler Cloud Geolocation to find the non-GPS location point. The zoom level can be provided in the `Map` constructor with the `zoom` option or will be `13` if not provided.
    
    If the value is `"COUNTRY"` (given by `GeolocationType.COUNTRY`) then the map is centered around the bounding box of the country. In this case, the `zoom` option will be ignored.
    
    If the value is `false`, no geolocation is performed and the map centering and zooming depends on other options or on the built-in defaults.
    
    If this option is non-false and the options `center` is also provided, then `center` prevails.
    
    Default: `false`
    
-   ##### `Optional`geolocateControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/)
    
    Show the geolocate control. (default: `true`, will hide if `false`)
    
-   ##### `Optional`halo?: [RadialGradientLayerConstructorOptions](https://docs.maptiler.com/sdk-js/api-reference/types/RadialGradientLayerConstructorOptions/) | boolean
    
-   ##### `Optional`language?: [LanguageInfo](https://docs.maptiler.com/sdk-js/api-reference/types/LanguageInfo/) | string
    
    Define the language of the map. This can be done directly with a language ISO code (eg. "en"), the ISO code prepended with the OSM flag (eg. "name:en" or even just "name"), or with a built-in shorthand (eg. Language.ENGLISH). Note that this is equivalent to setting the `config.primaryLanguage` and will overwrite it.
    
-   ##### `Optional`logSDKVersion?: boolean
    
    Whether to log the SDK version to the console. Default: Unless this is set explicitly to false, the SDK version will be logged to the console.
    
-   ##### `Optional`maptilerLogo?: boolean
    
    Shows or hides the MapTiler logo in the bottom left corner (only for paid plans). Default is `false` for paid plans.
    
    For free plans the MapTiler logo is always visible, and cannot be disabled.
    
    #### Example[](#example)
    
    ```typescript
    mapTilerLogo: false // hides the logo
    ```
    
    #### Example[](#example-1)
    
    ```typescript
    mapTilerLogo: true // shows the logo
    ```
    
-   ##### `Optional`minimap?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/) | [MinimapOptionsInput](https://docs.maptiler.com/sdk-js/api-reference/interfaces/MinimapOptionsInput/)
    
    Display a minimap in a user defined corner of the map. (default: `bottom-left` corner) If set to true, the map will assume it is a minimap and forego the attribution control.
    
-   ##### `Optional`navigationControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/)
    
    Show the navigation control. (default: `true`, will hide if `false`)
    
-   ##### `Optional`projection?: [ProjectionTypes](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.ProjectionTypes/)
    
    Whether the projection should be "mercator" or "globe". If not provided, the style takes precedence. If provided, overwrite the style.
    
-   ##### `Optional`projectionControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/)
    
    Show the projection control. (default: `false`, will show if `true`)
    
-   ##### `Optional`rtlTextPlugin?: boolean | string
    
    Whether to enable the RTL plugin or import a different one. Default is undefined, which means the plugin is enabled by default.
    
-   ##### `Optional`scaleControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/)
    
    Show the scale control. (default: `false`, will show if `true`)
    
-   ##### `Optional`space?: [CubemapLayerConstructorOptions](https://docs.maptiler.com/sdk-js/api-reference/types/CubemapLayerConstructorOptions/) | boolean
    
    Turn on/off spacebox.
    
    Default: { color: "#1D29F1" }
    
-   ##### `Optional`style?: [ReferenceMapStyle](https://docs.maptiler.com/sdk-js/api-reference/classes/ReferenceMapStyle/) | [MapStyleVariant](https://docs.maptiler.com/sdk-js/api-reference/classes/MapStyleVariant/) | [StyleSpecification](https://docs.maptiler.com/sdk-js/api-reference/types/StyleSpecification/) | string
    
    Style of the map. Can be:
    
    -   a full style URL (possibly with API key)
    -   a shorthand with only the MapTIler style name (eg. `"streets-v2"`)
    -   a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
    
-   ##### `Optional`terrain?: boolean
    
    Enables 3D terrain if `true`. (default: `false`)
    
-   ##### `Optional`terrainControl?: boolean | [ControlPosition](https://docs.maptiler.com/sdk-js/api-reference/types/ControlPosition/)
    
    Show the terrain control. (default: `false`, will show if `true`)
    
-   ##### `Optional`terrainExaggeration?: number
    
    Exaggeration factor of the terrain. (default: `1`, no exaggeration)
    
-   ##### `Optional`useExperimentalTilePreloading?: boolean
    
    Whether to enable the experimental tile preloading feature. Default is false.
    
    #### Experimental[](#experimental)
    
    #### Remarks[](#remarks)
    
    **API Key Usage**: Each tile request counts against your MapTiler Cloud API key quota. Use with caution.
