function draw_map_canvas(geojson_buffered_polygons, size=600, opacity_gradient=false, stroke_gradient=false, colour="teal") {
const opacity = d3.scalePow().exponent(3).domain([0, geojson_buffered_polygons.length - 1]).range([1, 0.1]);
const stroke_width = d3.scalePow().exponent(3).domain([0, geojson_buffered_polygons.length - 1]).range([1.4, 0.3]);
const context = DOM.context2d(width, size);
const path = d3.geoPath(d3.geoMercator().fitSize([width, size], geojson_buffered_polygons[geojson_buffered_polygons.length - 1]), context);
geojson_buffered_polygons.forEach(function(d,i){
context.beginPath();
path(geojson_buffered_polygons[i]);
context.strokeStyle = colour;
opacity_gradient ? context.globalAlpha = opacity(i) : 1;
stroke_gradient ? context.lineWidth = stroke_width(i) : 1;
context.stroke();
});
return context.canvas;
}