Carto-Art separates structure (the MapLibre style) from color (the palette). Mixing them is the easiest way to ship a coherent look.
Style and palette IDs
The style field on poster and map requests accepts either:
- a curated palette ID such as
alpine-swiss-green,obsidian-gold-standard-v2,ivory-ink-paper-v2oroceanic-deep-atlantic(recommended), or - a classic style ID:
minimal,dark-mode,midnight,blueprint,vintage,watercolor,abstract,atmospheric,organic,retro.
Pass anything else and the API returns a 400 that lists the valid style and palette IDs.
const poster = await client.posters.generate({
location: { lat: 51.5074, lng: -0.1278 },
style: 'obsidian-gold-standard-v2',
});
Discover the catalog
const catalog = await client.styles.list();
for (const category of catalog.categories) {
console.log(`${category.name}: ${category.palettes.map((p) => p.id).join(', ')}`);
}
console.log('Classic styles:', catalog.legacy.map((style) => style.id).join(', '));
console.log('Fonts:', (catalog.fonts ?? []).map((font) => font.family).join(', '));
GET /api/v1/styles/{id} resolves both style IDs and palette IDs, so you can
fetch the exact palette colors a poster will use before rendering.
Palette overrides
To tweak individual colors without writing a full palette, merge a partial
palette object through the request's config override:
const poster = await client.posters.generate({
location: { lat: 48.8566, lng: 2.3522 },
style: 'ivory-ink-paper-v2',
config: {
palette: {
background: '#0a0f1a',
water: '#1c2a42',
roads: { motorway: '#c9a962' },
buildings: '#f5f0e8',
},
},
});
Omitted palette keys keep the values from the selected style or palette. The
same override can be saved on a map with POST /api/v1/maps and patched later
with PATCH /api/v1/maps/{id}.
Typography
Load the font catalog from GET /api/v1/styles (fonts) before setting
config.typography.titleFont / subtitleFont. Unknown font families are
rejected with a 400 that lists the supported families, and title/subtitle text
the bundled poster fonts cannot render (CJK, Arabic, emoji, ...) is rejected
with a 400 naming the characters — it is never silently dropped. Latin
(including diacritics), Greek and Cyrillic are supported. The renderer falls
back to Noto Sans CJK/Arabic only when those fonts happen to be installed on the
render host; they are not bundled, so treat the 400 as the contract.
Performance tip
options.high_res is a legacy 2x resolution shortcut and is the same as
output.pixelRatio: 2. Prefer the explicit output.pixelRatio and check the
safe render sizes: a
default-size 2x render can be rejected with 422 render_too_large.