For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Type Alias MapOptions
apiKey?: string;
attributionControl?: AttributionControlOptions;
customAttribution?: string | string[];
customControls?: boolean | string;
forceNoAttributionControl?: boolean;
fullscreenControl?: boolean | ControlPosition;
geolocate?: typeof GeolocationType[keyof typeof GeolocationType] | boolean;
geolocateControl?: boolean | ControlPosition;
globeMercatorSwitchZoom?: number | false;
halo?: RadialGradientLayerConstructorOptions | boolean;
language?: LanguageInfo | string;
logSDKVersion?: boolean;
maptilerLogo?: boolean;
minimap?: boolean | ControlPosition | MinimapOptionsInput;
navigationControl?: boolean | ControlPosition;
projection?: ProjectionTypes;
projectionControl?: boolean | ControlPosition;
scaleControl?: boolean | ControlPosition;
space?: CubemapLayerConstructorOptions | boolean;
style?: ReferenceMapStyle | MapStyleVariant | StyleSpecification | string;
terrain?: boolean;
terrainControl?: boolean | ControlPosition;
terrainExaggeration?: number;
useExperimentalTilePreloading?: boolean;
}
Type Declaration
OptionalapiKey?: stringDefine the MapTiler Cloud API key to be used. This is strictly equivalent to setting
config.apiKeyand will overwrite it.OptionalattributionControl?: AttributionControlOptionsOptions for an AttributionControl.
OptionalcustomAttribution?: string | string[]Attributions to show in addition to any other attributions in an AttributionControl.
OptionalcustomControls?: boolean | stringDetect custom external controls. (default:
false, will detect automatically iftrue)OptionalforceNoAttributionControl?: booleanattributionControl
OptionalfullscreenControl?: boolean | ControlPositionShow the full screen control. (default:
false, will show iftrue)Optionalgeolocate?: typeof GeolocationType[keyof typeof GeolocationType] | booleanMethod to position the map at a given geolocation. Only if:
hashisfalsecenteris not provided
If the value is
trueof"POINT"(given byGeolocationType.POINT) then the positionning uses the MapTiler Cloud Geolocation to find the non-GPS location point. The zoom level can be provided in theMapconstructor with thezoomoption or will be13if not provided.If the value is
"COUNTRY"(given byGeolocationType.COUNTRY) then the map is centered around the bounding box of the country. In this case, thezoomoption 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
centeris also provided, thencenterprevails.Default:
falseOptionalgeolocateControl?: boolean | ControlPositionShow the geolocate control. (default:
true, will hide iffalse)OptionalglobeMercatorSwitchZoom?: number | falseMapLibre's plain
type: "globe"already resolves to["interpolate", ["linear"], ["zoom"], 11, "vertical-perspective", 12, "mercator"]— vertical-perspective below zoom 11, linearly blended into flat mercator between 11 and 12. That blend is a MapLibre bug for anything that places objects via its per-projection model matrix (marker altitude,maptiler-3d-js): the matrix isn't well-defined mid-blend, only once it's settled fully at one end, so objects placed while zooming through 11-12 jump around.Whenever a projection change resolves to
"globe"(constructor option,setProjection, or the MaptilerProjectionControl), the SDK requests{ type: ["step", ["zoom"], "vertical-perspective", globeMercatorSwitchZoom, "mercator"] }instead of the literal string — spherical below this zoom, flat mercator at and above it, snapping instantly at the threshold instead of blending across that zoom band.Set to
falseto request MapLibre's own"globe"literally instead, blend bug and all.Default:
11Optionalhalo?: RadialGradientLayerConstructorOptions | booleanOptionallanguage?: LanguageInfo | stringDefine 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.primaryLanguageand will overwrite it.OptionallogSDKVersion?: booleanWhether 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.
OptionalmaptilerLogo?: booleanShows or hides the MapTiler logo in the bottom left corner (only for paid plans). Default is
falsefor paid plans.For free plans the MapTiler logo is always visible, and cannot be disabled.
Optionalminimap?: boolean | ControlPosition | MinimapOptionsInputDisplay a minimap in a user defined corner of the map. (default:
bottom-leftcorner) If set to true, the map will assume it is a minimap and forego the attribution control.OptionalnavigationControl?: boolean | ControlPositionShow the navigation control. (default:
true, will hide iffalse)Optionalprojection?: ProjectionTypesWhether the projection should be "mercator" or "globe". If not provided, the style takes precedence. If provided, overwrite the style.
OptionalprojectionControl?: boolean | ControlPositionShow the projection control. (default:
false, will show iftrue)OptionalscaleControl?: boolean | ControlPositionShow the scale control. (default:
false, will show iftrue)Optionalspace?: CubemapLayerConstructorOptions | booleanTurn on/off spacebox.
Default: { color: "#1D29F1" }
Optionalstyle?: ReferenceMapStyle | MapStyleVariant | StyleSpecification | stringStyle of the map. Can be:
- a full style URL (possibly with API key)
- a shorthand with only the MapTIler style name (eg.
"streets-v4") - a longer form with the prefix
"maptiler://"(eg."maptiler://streets-v4")
Optionalterrain?: booleanEnables 3D terrain if
true. (default:false)OptionalterrainControl?: boolean | ControlPositionShow the terrain control. (default:
false, will show iftrue)OptionalterrainExaggeration?: numberExaggeration factor of the terrain. (default:
1, no exaggeration)OptionaluseExperimentalTilePreloading?: booleanWhether to enable the experimental tile preloading feature. Default is false.
Options to provide to the
Mapconstructor