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;
halo?: RadialGradientLayerConstructorOptions | boolean;
language?: LanguageInfo | string;
logSDKVersion?: boolean;
maptilerLogo?: boolean;
minimap?: boolean | ControlPosition | MinimapOptionsInput;
navigationControl?: boolean | ControlPosition;
projection?: ProjectionTypes;
projectionControl?: boolean | ControlPosition;
rtlTextPlugin?: boolean | string;
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)Optionalhalo?: 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)OptionalrtlTextPlugin?: boolean | stringWhether to enable the RTL plugin or import a different one. Default is undefined, which means the plugin is enabled by default.
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-v2") - a longer form with the prefix
"maptiler://"(eg."maptiler://streets-v2")
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