Render a map to an image on the server.
render/1 takes a centre, a zoom and a size, fetches the tiles that cover that view from
a StaticMaps.Source, stitches them into one image and returns the encoded bytes.
Summary
Functions
Renders a map and returns the encoded image.
Functions
@spec render(keyword()) :: {:ok, binary()} | {:error, Exception.t()}
Renders a map and returns the encoded image.
Options
:center—{lat, lng}in degrees, required:zoom— integer zoom within the source's range, required:source— a module implementingStaticMaps.Source, or{module, opts}; defaults toStaticMaps.Source.OSM:size—{width, height}in pixels before:scale, at most{2048, 2048}; defaults to{600, 400}:scale—1or2; defaults to1:format—:pngor:jpeg; defaults to:png:background—"#rrggbb","#rgb"or{r, g, b}, painted wherever no tile covers the image; defaults to"#e0e0e0":on_tile_error—:failreturns{:error, %StaticMaps.TileError{}}when any tile cannot be fetched or decoded;:fillpaints those tiles with:backgroundand returns the image anyway. Defaults to:fail.
Returns {:error, %ArgumentError{}} for invalid options.