map = {
const context = this ? this.getContext("2d") : DOM.context2d(width , width - (width/2));
const render = function() {
const path = d3.geoPath(projection, context);
const rotate = projection.rotate();
const backpath = d3.geoPath(backprojection.rotate([rotate[0]+180, -rotate[1], -rotate[2]]), context);
context.clearRect(-0, -0, width, width);
context.beginPath(), path({type:"Sphere"}),
context.fillStyle = '#fcfcfc', context.fill();
context.beginPath(), backpath(land),
context.fillStyle = backColor, context.fill();
context.beginPath(), backpath(d3.geoGraticule()()),
context.lineWidth = .1, context.strokeStyle = '#aaa', context.stroke();
context.beginPath(), path(d3.geoGraticule()()),
context.lineWidth = .2, context.strokeStyle = '#111', context.stroke();
context.beginPath(), path(land),
context.globalAlpha = 0.9,
context.lineWidth = 1, context.strokeStyle = '#000000', context.stroke(),
context.fillStyle = frontColor, context.fill(),
context.globalAlpha = 1;
context.beginPath(), path({type: "Sphere"}),
context.lineWidth = 15, context.strokeStyle = "rgba(80,205,255,0.2)", context.stroke();
context.beginPath(), path({type: "Sphere"}),
context.lineWidth = 2, context.strokeStyle = "rgba(0,0,0,0.9)", context.stroke();
}
context.canvas.inertia = d3.geoInertiaDrag(d3.select(context.canvas), null, projection);
const timer = d3.timer(function() {
var rotate = projection.rotate();
rotate[0] += velocity * 10;
projection.rotate(rotate);
render();
});
invalidation.then(() => (timer.stop(), timer = null, d3.select(context.canvas).on(".drag", null)));
return context.canvas;
}