node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »


Interactive Earth Tiles

Rasterise tiles onto any d3 geo projection.

See the Interactive Earth Handbook for an example of how to group the interactive-earth modules together into a visualisation.

var tiles = require('interactive-earth-tiles');
var graticule = require('interactive-earth-tiles/graticule');
var coords = require('interactive-earth-tiles/coords');
// All options shown 
var naturalearth = tiles({
  classname: '',
  url: '//{subdomain}{z}/{x}/{y}.png'
  subdomains: ['a', 'b', 'c', 'd'],
  scaleExtent: [0, 6],
  tms: false
var graticuleLayer = graticule();
var coordsLayer = coords();
layers.push(['tiles', naturalearth]);
layers.push(['graticule', graticuleLayer]);
layers.push(['coords', coordsLayer]);
earth.render(layers, projection, quad);