Skip to content

Commit

Permalink
fix canvas import (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
acalcutt authored Oct 28, 2022
1 parent b6e2d10 commit 212af81
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/serve_rendered.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import url from 'url';
import util from 'util';
import zlib from 'zlib';
import sharp from 'sharp'; // sharp has to be required before node-canvas. see https://github.com/lovell/sharp/issues/371
import pkg from 'canvas';
import {createCanvas, Image} from 'canvas';
import clone from 'clone';
import Color from 'color';
import express from 'express';
Expand All @@ -22,7 +22,6 @@ import {getFontsPbf, getTileUrls, fixTileJSONCenter} from './utils.js';
const FLOAT_PATTERN = '[+-]?(?:\\d+|\\d+\.?\\d+)';
const httpTester = /^(http(s)?:)?\/\//;

const {createCanvas, Image} = pkg;
const mercator = new SphericalMercator();
const getScale = (scale) => (scale || '@1x').slice(1, 2) | 0;

Expand Down

0 comments on commit 212af81

Please sign in to comment.