The example code is from the readme.md file. I also tried with the newest version of maplibre-gl (3.1.0), but got the same error.
`<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Map</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" rel="stylesheet" />
<link href='https://www.unpkg.com/@watergis/[email protected]/dist/maplibre-gl-export.css' rel='stylesheet' />
<script src="https://www.unpkg.com/@watergis/[email protected]/dist/maplibre-gl-export.umd.js"></script>
<style>
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
</style>
</head>
<body>
<div id="map"></div>
<script>
var map = new maplibregl.Map({
container: 'map', // container id
style:
'https://api.maptiler.com/maps/streets/style.json?key=xxxxxx',
center: [-96, 37.8],
zoom: 3
});
map.addControl(new MaplibreExportControl({
PageSize: Size.A3,
PageOrientation: PageOrientation.Portrait,
Format: Format.PNG,
DPI: DPI[96],
Crosshair: true,
PrintableArea: true,
Local: 'en'
}), 'top-right');
</script>
</body>
</html>`