OptionalbearingThe compass direction that is up, in degrees, as in MapLibre: 90 puts east at the
top. The map turns around the image's center; labels stay upright.
OptionalfetchLoads tiles, sprites, TileJSON documents and GeoJSON data, like fetch, which is the default. Pass your own to send
headers, go through a proxy, or keep tiles in a cache on disk.
It must return a real Response, and its status matters: a 404 or 204 means the
server has no such tile, which is remembered (see SVGMapRendererOptions.tileCacheSize); any other
error status, or a rejected promise, counts as failed, and the next render tries
again.
OptionalglobalValues for the style's global state, read by global-state expressions, e.g. to
switch the language or a theme of a style. They override the defaults in the style's
state, like map.setGlobalStateProperty(name, value) in MapLibre GL JS.
OptionalheightHeight of the image in pixels.
OptionallabelsWhether and how to draw the style's symbol layers, its labels and icons:
'none': neither labels nor icons.'text': labels as <text> naming the style's fonts (text-font), which whatever
displays the SVG resolves, so they show in the intended typeface only where that font
is installed. In PNG output, with the fonts given by fonts.'glyphs': labels as the style's own glyphs (glyphs), the letter shapes MapLibre
draws, traced into outlines: exact in every viewer and editor, but not text. Each
glyph is defined once and reused.'glyphs-text': as 'glyphs', with the text laid invisibly over the outlines, so labels
stay selectable and searchable. (In PNG output, the same as 'glyphs'.)Labels are placed as in MapLibre: at points, inside each polygon at the point farthest
from its edges, and along lines; labels and icons that would overlap one placed before
are left out, from the top layer down. With glyphs, they are laid out with MapLibre's
own metrics; as text, with the widths of Noto Sans. A style without glyphs, or glyphs
that cannot be loaded, fall back to 'text', reported through onWarning.
'none', or as given by SVGMapRendererOptions.renderLabels
OptionallatLatitude of the map centre, in degrees.
OptionallonLongitude of the map centre, in degrees.
OptionalonCalled with a message for each part of the style the renderer does not draw: a layer
type, a layer property, a source, or a TileJSON document that could not be loaded. Each
message is reported once per instance. Pass () => {} to silence them.
Properties that make no difference to a flat, north-up map (e.g. *-pitch-alignment)
are not reported, nor are symbol layers unless SVGMapRendererOptions.labels
is set.
OptionalpaddingSpace around the map's center, in pixels, as MapLibre's padding: the center (lon,
lat) sits in the middle of the area inside it, e.g. to keep it clear of a panel laid
over the image. A number applies to all sides.
OptionalrenderDraw the style's labels and icons.
Use SVGMapRendererOptions.labels: true is 'glyphs-text', false
is 'none'.
The MapLibre style to render.
A source may list its tile URLs (tiles: [...]) or point at a TileJSON document
(url: '.../tiles.json'), which is fetched once, like the sprite, with
SVGMapRendererOptions.fetch. As in MapLibre GL JS, tiles, minzoom,
maxzoom and the like come from the document unless the style sets them, and
relative tile URLs are resolved against the document's URL. A GeoJSON source's data
may be a URL too. A source whose TileJSON or GeoJSON cannot be loaded is left out, and
the next render tries again.
OptionalwidthWidth of the image in pixels.
OptionalzoomZoom level, as in MapLibre: each step doubles the scale. Fractional values are allowed.
Options for renderToSVG: the style and the view, in one object.