1.1.0 • Published 8 years ago

interactive-earth v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 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

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.21

9 years ago

0.1.20

9 years ago

0.1.19

9 years ago

0.1.18

9 years ago

0.1.17

9 years ago

0.1.16

9 years ago

0.1.15

9 years ago

0.1.14

9 years ago

0.1.13

9 years ago

0.1.12

9 years ago

0.1.11

9 years ago

0.1.10

9 years ago

0.1.9

9 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago