Lighter Maps, Zero Dependencies: Native Basemap Tiles in CanvasXpress

If you've built a geographic visualization in CanvasXpress — a choropleth, a marker map, a flow map over a real-world backdrop — you've probably turned on a street, terrain, labels, or satellite basemap to give your data geographic context. Until now, that basemap was quietly powered by an external library loaded behind the scenes. Today, that's no longer the case: CanvasXpress draws its own tile basemaps natively, with no external JavaScript or CSS, no hidden overlay markup, and no asynchronous library load standing between your chart and the screen.

What changed, and why you'll notice

Previously, enabling a tile backdrop meant CanvasXpress fetched a third-party mapping library over the network the first time it was needed, injected its stylesheet, and created a hidden <div> layered underneath your chart canvas to host the map tiles. It worked, but it came with real costs: an extra network round-trip before your map could render, a timing dance to keep the hidden layer in sync with your chart's size and zoom, and a fragile path for exporting maps to PNG that had to scrape tile images out of that hidden layer's internal DOM structure.

CanvasXpress already does all the hard mathematical work of a geographic map — Mercator projection, world-pixel scaling, coordinate transforms — as native engine code. It turns out that same math is exactly what's needed to compute which map tiles are visible and where to place them. So the tile basemap is now drawn directly onto a canvas layer the engine manages itself, using the same projection math your charts already rely on. The result is a basemap that:

From a configuration standpoint, nothing about how you ask for a basemap has changed in spirit — you're still choosing a tile style and tuning how it blends with your data layer. The options now live under a tiles-oriented vocabulary that makes the intent explicit:

var cx = new CanvasXpress(
  "canvasId",
  {
    // your map data: geojson-backed choropleth, markers, etc.
  },
  {
    graphType: "Map",
    showTiles: true,
    tileType: "terrain",
    tileAlpha: 0.7,
    tileZoomAlphaColor: 6
  }
);

You can toggle or retune any of this on a live chart the same way you'd adjust any other setting:

cx.updateConfig({ tileType: "satellite", tileAlpha: 0.5 }, true);

And if you want to confirm exactly what's currently driving your map's basemap, cx.getConfig() will return the resolved configuration, tile settings included.

Attribution, built in

Every one of the four basemap styles draws from an open tile provider — OpenStreetMap, OpenTopoMap, Carto, and USGS imagery — and each requires visible attribution as a condition of free use. CanvasXpress now renders that attribution directly onto the map canvas itself, which means it's no longer something that could be silently lost if you export your chart. Save the chart as an image, and the attribution travels with it, baked into the pixels rather than floating in a separate DOM layer that an export step has to go find.

Why this matters beyond the obvious

The dependency removal is the headline, but the quieter win is robustness. Anything that used to depend on a remote library loading successfully, in order, before your map could finish initializing is now simply computed synchronously as part of the chart's own render path. If you've ever seen a map chart render with an unexpectedly blank backdrop on a slow connection or a flaky network, that entire class of problem goes away — there's no load race to lose.

It also means your saved and reproduced charts are more self-contained. Using the toolbar's Save as JSON action captures your map's full configuration, including its tile settings, and dropping that saved file back onto a chart container reloads it faithfully — no dependency on an external map library being available or loading in the same sequence it did originally. The Reproduce action in the toolbar, which replays a chart's construction step by step, now does so without any detour through a third-party map stack either.

Try it

If you already have a Map-type chart with a basemap enabled, your existing config keeps working as-is — the old keys are still accepted. That said, the configuration vocabulary is now explicitly tile-oriented, and the new names are the ones to reach for going forward: useLeaflet → showTiles, leafletTileType → tileType, leafletAlpha → tileAlpha, and leafletZoomAlphaColor → tileZoomAlphaColor. The values and the visual result are unchanged — the same four tile styles you're used to, now rendered natively. If you're adding a geographic backdrop for the first time, reach for showTiles and tileType in your config, tune tileAlpha and tileZoomAlphaColor to taste, and you have a fully self-contained, exportable, dependency-free basemap behind your data.

Fewer moving parts, the same visual outcome, and one less external library your deployment has to trust — that's the trade CanvasXpress just made on your behalf.