Skip to content

Commit

Permalink
Fix file opening issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bugra9 committed Mar 10, 2022
1 parent a41f9d3 commit 3a27029
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .info.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"licenseUrl": "https://github.com/emscripten-core/emscripten/blob/main/LICENSE"
},
{
"name": "Gdal 3.4.0",
"name": "Gdal 3.4.1",
"url": "https://github.com/OSGeo/gdal",
"licenseUrl": "https://github.com/OSGeo/gdal/blob/master/gdal/LICENSE.TXT"
},
Expand Down
4 changes: 3 additions & 1 deletion GDAL_EMCC_FLAGS.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ GDAL_EMCC_FLAGS += -s EXPORTED_FUNCTIONS="[\
'_GDALGenImgProjTransform',\
'_GDALCreateGenImgProjTransformer2',\
'_GDALDestroyGenImgProjTransformer',\
'_OSRSetFromUserInput'\
'_OSRSetFromUserInput',\
'_CPLSetConfigOption',\
'_CPLSetThreadLocalConfigOption'\
]"

GDAL_EMCC_FLAGS += -s EXTRA_EXPORTED_RUNTIME_METHODS="[\
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GDAL_VERSION = 3.4.0
GDAL_VERSION = 3.4.1
SPATIALITE_VERSION = 5.0.1
SQLITE_VERSION = 3370000
GEOS_VERSION = 3.9.2
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ PDF, PGDUMP
Note: It doesn't work with web worker.
```html
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/package/gdal3.js"
integrity="sha384-kBK/1E7Ucftl+q9BgJLSjxYXl50E04hunMphr89+UG/L624dOkyzC4dMiIjHGZND"
src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/package/gdal3.js"
integrity="sha384-BRUDikOiBTBuQJEujfwicGrKL+KqI8gWVEDxrBiumId37JQdQbXrWVfxFz46Ufzj"
crossorigin="anonymous"
></script>
```

```js
initGdalJs({ path: 'https://cdn.jsdelivr.net/npm/[email protected].1/dist/package', useWorker: false }).then((Gdal) => {});
initGdalJs({ path: 'https://cdn.jsdelivr.net/npm/[email protected].2/dist/package', useWorker: false }).then((Gdal) => {});
```
> Example: [https://github.com/bugra9/gdal3.js/tree/master/apps/example-browser](https://github.com/bugra9/gdal3.js/tree/master/apps/example-browser) \
Expand Down Expand Up @@ -211,7 +211,7 @@ See [LICENSE](https://github.com/bugra9/gdal3.js/blob/master/LICENSE) to see the

**Compiled with**
- [Emscripten 1.39.19](https://github.com/emscripten-core/emscripten) [(License)](https://github.com/emscripten-core/emscripten/blob/main/LICENSE)
- [Gdal 3.4.0](https://github.com/OSGeo/gdal) [(License)](https://github.com/OSGeo/gdal/blob/master/gdal/LICENSE.TXT)
- [Gdal 3.4.1](https://github.com/OSGeo/gdal) [(License)](https://github.com/OSGeo/gdal/blob/master/gdal/LICENSE.TXT)
- [Proj 6.3.2](https://github.com/OSGeo/PROJ) [(License)](https://github.com/OSGeo/PROJ/blob/master/COPYING)
- [Geos 3.9.2](https://github.com/libgeos/geos) [(License)](https://github.com/libgeos/geos/blob/master/COPYING)
- [Spatialite 5.0.1](https://www.gaia-gis.it/fossil/libspatialite/index) [(License)](http://www.gnu.org/licenses/lgpl-2.1.html)
Expand Down
2 changes: 1 addition & 1 deletion apps/app-gui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gdal3.js-gui",
"version": "2.0.1",
"version": "2.0.2",
"description": "gdal3.js GUI is a open source project offering a user interface for Gdal.",
"license": "GPL-3.0-or-later",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions apps/example-browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/package/gdal3.js"
integrity="sha384-kBK/1E7Ucftl+q9BgJLSjxYXl50E04hunMphr89+UG/L624dOkyzC4dMiIjHGZND"
src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/package/gdal3.js"
integrity="sha384-BRUDikOiBTBuQJEujfwicGrKL+KqI8gWVEDxrBiumId37JQdQbXrWVfxFz46Ufzj"
crossorigin="anonymous"
></script>
<script type="text/javascript" src="main.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion apps/example-browser/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
document.write("Loading...");
initGdalJs({ path: 'https://cdn.jsdelivr.net/npm/[email protected].1/dist/package', useWorker: false }).then((Gdal) => {
initGdalJs({ path: 'https://cdn.jsdelivr.net/npm/[email protected].2/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);
Expand Down
2 changes: 1 addition & 1 deletion apps/example-node/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dependencies": {
"gdal3.js": "2.0.1"
"gdal3.js": "2.0.2"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gdal3.js",
"version": "2.0.1",
"version": "2.0.2",
"description": "gdal3.js is a port of Gdal applications (**gdal_translate**, **ogr2ogr**, **gdal_rasterize**, **gdalwarp**, **gdaltransform**) to Webassembly. It allows you to convert raster and vector geospatial data to various formats and coordinate systems.",
"license": "GPL-3.0-or-later",
"homepage": "https://gdal3.js.org",
Expand Down Expand Up @@ -33,7 +33,7 @@
"build-src-all": "yarn run build-src && yarn run build-src-withcoverage",
"build-spec": "mkdir -p build/test/specs/ && cp src/**/**/*.spec.js build/test/specs/ && cp test/*.spec.js build/test/specs/ && cp test/browser.html build/test/index.html && cp -r test/data build/test/data",
"build-gui": "cd apps/app-gui && yarn install && yarn run build",
"build-docs": "jsdoc --configure .jsdoc.json --verbose && cp -r build/docs/gdal3.js/2.0.1/* build/docs",
"build-docs": "jsdoc --configure .jsdoc.json --verbose && cp -r build/docs/gdal3.js/2.0.2/* build/docs",
"test-node": "nyc --reporter=json --reporter=html --report-dir=./build/coverage/node mocha",
"test-browser": "karma start .karma.conf.js",
"test-coverage": "istanbul-merge --out build/coverage/coverage-final.json build/coverage/browser/coverage-final.json build/coverage/node/coverage-final.json && nyc report --reporter html -t build/coverage --report-dir build/coverage"
Expand Down
2 changes: 1 addition & 1 deletion src/allJsFunctions/helper/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function mount(files) {
files.forEach((file) => {
const temp = file.split('/');
const name = temp.pop();
const path = temp.join('/');
const path = temp.join('/') || '.';

if (lastInputMountedPath !== path) {
if (lastInputMountedPath) unmount();
Expand Down

0 comments on commit 3a27029

Please sign in to comment.