render_png()writes or returns a PNG.render_svg()writes or returns an SVG document (widthxheightuser units;pixel_ratiodoes not apply): vector layers as paths and text, raster tiles (raster basemaps, hillshade) as embedded images.render_array()returns an integer array[height, width, 4](RGBA, 0–255) with the extent as attributes, likerender_basemap_raw().render_raster()(R only) returns aterra::rast()(EPSG:3857, layers red, green, blue, alpha).
Arguments
- m
A
basemap()object.- path
Output file, or
NULLto return the result.- text
For
render_svg():"editable"writes labels as<text>elements (editable, selectable) at MapLibre's glyph positions, halos as strokes, with the style's fonts embedded, and falls back to"bitmap"for labels whose font file is not available;"bitmap"draws every label from the style's own glyph bitmaps, thresholded by SVG filters as MapLibre's shader does (MapLibre's look at any zoom, not editable);"paths"writes glyph outlines traced from those bitmaps (plain paths).- embed_fonts
For
render_svg():"subset"(only the glyphs used),"full"(whole fonts, for retyping labels) or"none"(fonts by name only). Fonts come fromfont_dirs, theBASEMAPPER_FONT_DIRSfolders, a local cache, then Google Fonts for open fonts; others are referenced by name.- font_dirs
For
render_svg(): folders of .ttf / .otf files to use first.