Type Alias StaticMapBaseOptions
apiKey?: string;
attribution?: "bottomright" | "bottomleft" | "topleft" | "topright" | false;
format?: "png" | "jpg" | "webp";
height?: number;
hiDPI?: boolean;
markerAnchor?:
| "top"
| "left"
| "bottom"
| "right"
| "center"
| "topleft"
| "bottomleft"
| "topright"
| "bottomright";
markerIcon?: string;
markers?: StaticMapMarker
| StaticMapMarker[];
path?: Position[];
pathFillColor?: string;
pathStrokeColor?: string;
pathWidth?: number;
style?: string | ReferenceMapStyle | MapStyleVariant;
width?: number;
}
Properties
OptionalapiKey
Custom MapTiler Cloud API key to use instead of the one in global config
Optionalattribution
Placement of the attribution. Can also be set to false to not show attribution.
Default: "bottomright"
Optionalformat
Image format.
Default: "png"
Optionalheight
Height of the output image. Maximum value: 2048.
Default: 1024
OptionalhiDPI
Double the size of the static map image to support hiDPI/Retina monitors.
Default: false
OptionalmarkerAnchor
| "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"
OptionalmarkerIcon
URL of the marker image. Applies only if one or multiple markers positions are provided. Default: none provided
Optionalmarkers
A marker or list of markers to show on the map Default: none provided
Optionalpath
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
OptionalpathFillColor
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)
OptionalpathStrokeColor
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"
OptionalpathWidth
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.
Optionalstyle
Style of the map (not full style URL). Example: "winter", "streets-v2".
Default: "streets-v2"
Optionalwidth
Width of the output image. Maximum value: 2048.
Default: 1024
Base set of options that can be provided to all the types of static maps