1.1.0 • Published 10 years ago

interactive-earth v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

Interactive Earth

Inspired by earth wind map. A modular visualisation of the earth using layers and d3 projections.

This repo has inspiration code from earth which will eventually be removed. This codebase simply groups together layers and provides a 'layer diff' technique for fast reordering and rerendering of layers.

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

Enjoy.

// compute
var d3 = require('d3');
var quadtiles = require('d3-quadtiles');
var projection = d3.geo.orthographic()
  .precision(0.1)
  .clipAngle(90)
  .rotate([-150, 25])
  .scale(150)
  .translate([300, 240])
  .clipExtent([[0, 0], [600, 480]]);
var quadtiles = require('d3-quadtiles');
var quad = quadtiles(projection, { maxtiles: 32, maxzoom: 18 });

// ui
var el = document.querySelector('#map');
var interactiveEarth = require('interactive-earth');
var earth = interactiveEarth(el, { classname: 'earth' });
var tiles = require('interactive-earth-tiles');
var naturalearth = tiles({ url: '//{subdomain}.tiles.mapbox.com/v3/mapbox.natural-earth-2/{z}/{x}/{y}.png' });

var layers = [];
layers.push(['tiles', naturalearth]);

// every update or frame
earth.render(layers, projection, quad);

Each layer is indexed by a string id which is used to update the correct dom element.

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.21

10 years ago

0.1.20

10 years ago

0.1.19

10 years ago

0.1.18

10 years ago

0.1.17

10 years ago

0.1.16

10 years ago

0.1.15

10 years ago

0.1.14

10 years ago

0.1.13

10 years ago

0.1.12

10 years ago

0.1.11

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago