rangement exemple bibliothèque GdalJavascript

This commit is contained in:
JS 2023-10-29 22:24:25 +01:00
parent 979c2d948b
commit 2e27417fc5
3 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/gdal3.js@2.4.0/dist/package/gdal3.js"
integrity="sha384-XlqVvSG4V8zz8Kdw95OpRdsWyJnWE5QUZy++BeAIEVb+f2n5RM7jdbZh5lm0pHWk"
crossorigin="anonymous"
></script>
<script type="text/javascript" src="main.js"></script>
</head>
<body>
</body>
</html>

View file

@ -0,0 +1,6 @@
document.write("Loading...");
initGdalJs({ path: 'https://cdn.jsdelivr.net/npm/gdal3.js@2.4.0/dist/package', useWorker: false }).then((Gdal) => {
const count = Object.keys(Gdal.drivers.raster).length + Object.keys(Gdal.drivers.vector).length;
document.write("Number of drivers: " + count);
console.log(Gdal.drivers);
});