function map(projection) {
const height = width / 2;
const context = DOM.context2d(width, height);
projection.preclip(preclip);
projection.fitExtent([[width/6,height/6],[width*5/6, height*5/6]], {type:"Sphere"});
var path = d3.geoPath(projection, context);
context.clearRect(0,0,width, width/2);
context.beginPath(), path(P1), context.fillStyle = "lime", context.fill();
context.beginPath(), path(P2), context.fillStyle = "cyan", context.fill(), context.stroke();
projection.preclip(d3.geoClipAntimeridian)
context.globalAlpha = 0.3;
context.beginPath(), path(P1), context.fillStyle = "lime", context.fill();
context.beginPath(), path(P2), context.fillStyle = "cyan", context.fill();
context.beginPath(), path(d3.geoGraticule()()), context.strokeStyle = "#ccc", context.stroke();
context.globalAlpha = 1;
return context.canvas;
}