API and agentsAPI reference
Viz
object
How the layer's result is drawn. points (default) draws the raw features. hexbin and grid aggregate points into cells server-side — results beyond the render cap stay renderable; cells expose value and count, colored by the viz fill (assigned automatically when omitted). heatmap draws point density. arc and line draw each row as an origin→destination pair from the mapped endpoints — arc as a curved swing with an adjustable height, line straight; the path's source color and width ride the style's stroke channels, and targetColor blends toward the destination. icon draws points as a glyph from the curated bundled set — size rides the style's point-radius channel, color its fill channel, fixed or by attribute. cluster aggregates points client-side into count-labeled bubbles by a pixel radius; zooming in dissolves them; clicking a bubble zooms toward where it breaks apart. Non-point layers keep simple rendering. hexbin/grid may carry elevation: cells extrude by an aggregate — count, or a function over a numeric field — so color and height can encode different things; the aggregate's range is resolved server-side and maps linearly onto [0, height] meters. Absent = flat, exactly as before.
typestringrequiredOne of
points,hexbin,grid,heatmap,arc,line,icon,clustercellKmnumberhexbin/grid: cell edge length in web-mercator kilometres — a length on the map projection, not a ground distance. Web mercator stretches by 1/cos(latitude), so a 1.2 km cell covers about 730 m of ground at 52°N and about 410 m at 70°N. Any value 0.02-1000 (hexbin: hexagon edge; grid: square edge). Every other distance in this API — a buffer radius, a measured length — is ground metres.
aggregateAggregatefillFillPaintelevationobjecthexbin/grid cell extrusion. height = the tallest prism in meters (100-20000); domain is resolved server-side — send aggregate and height only.
aggregateAggregaterequiredheightnumberrequiredminimum100maximum20000domainarray of numbermin items2max items2
radiusPxnumberheatmap: kernel radius in pixels (1-200). cluster: clustering radius in pixels (20-120).
intensitynumberheatmap: intensity multiplier (0.1-10).
weightstringor nullheatmap: numeric attribute weighting each point; null = 1.
originOdEndpointdestOdEndpointheightnumberarc: swing relative to the endpoint distance (0.1-2).
targetColorobjectarc/line: destination end of the color gradient as {r, g, b, a}; omit for one fixed color.
glyphstringicon: the glyph name from the curated Maki subset (e.g. 'cafe', 'parking', 'marker').
customSvgstringor nullicon: sanitized custom SVG markup; when present it wins over the glyph, tinted by the fill channel like any glyph. Writes pass through the sanitizer — scripts, event handlers and references are stripped and reported (preview via /api/icons/sanitize); not-SVG, oversize (256 KB), and nothing-drawable inputs answer invalid_request. Null clears back to the glyph.
colorcluster: 'fixed' paints the style's fill color; an Aggregate ({fn} or {fn, attribute}) colors bubbles on a sequential ramp over the current view's values.
showCountsbooleancluster: draw the count label on each bubble.
7439201b