Tristan Peralta
A server-rendered map of Metro Manila with three coloured markers

Libraries 2026

StaticMaps

Server-rendered maps for pages that do not need to pan.

StaticMaps renders a map to an image on the server. Give it a centre, a zoom, and a size; it works out which tiles cover the view, fetches them, stitches and crops them, draws markers and attribution, and returns the bytes. The browser receives an <img>.

That constraint is the product. A map that never moves does not need a client-side map library, a tile cache in the browser, or a JavaScript bundle. One render produces one image that can be cached for as long as the content lives, and a page view costs no tile requests.

The StaticMaps pipeline: centre and zoom choose tiles, the cache serves them, tiles are stitched and cropped, markers and attribution are drawn, and the image is encoded
The render pipeline. The tile cache is what keeps repeat renders within the provider’s usage policy.

Tiles, fairly

StaticMaps sends an identifying User-Agent with every tile request, and the application supplies a contact URL. The attribution strip is drawn into the image using the fonts installed through fontconfig, which is why a slim container needs one installed. Those details are not decoration: OpenStreetMap’s tile servers are volunteer-run, and a server-side renderer is exactly the client that should behave.

Where it fits

Property listings, office addresses, a photo’s location, Open Graph images, and PDFs. Mosaic uses it for the map on a photo’s location; the map is rendered once and attached to the page like any other image.

Status

StaticMaps is published on Hex as staticmaps. The library renders and caches images; StaticMaps.Plug serves them over HTTP when an application needs an endpoint rather than a file.