Skip to content

Commit 0f5da9e

Browse files
committed
JS: Replace proj4js by proj4rs WASM
Proj4rs is Rust adaptation of Proj4. It provides a JS API like proj4js to be reusable with OpenLayers. * Source code https://github.com/3liz/proj4rs * JavaScript Demo https://docs.3liz.org/proj4rs/
1 parent 9e4d467 commit 0f5da9e

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

assets/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import executeJSFromServer from './modules/ExecuteJSFromServer.js';
3232

3333
import olDep from './dependencies/ol.js';
3434
import litHTMLDep from './dependencies/lit-html.js';
35-
import proj4 from 'proj4';
35+
import { proj4 } from 'proj4rs/proj4.js';
3636

3737
/**
3838
* waitFor function returns waiting time in milliseconds

assets/src/modules/Lizmap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { Extent as olExtent, intersects as olExtentIntersects} from 'ol/extent.j
3535
import { transform as olTransform, transformExtent as olTransformExtent, get as getProjection } from 'ol/proj.js';
3636
import { register } from 'ol/proj/proj4.js';
3737

38-
import proj4 from 'proj4';
38+
import { proj4 } from 'proj4rs/proj4.js';
3939
import ProxyEvents from './ProxyEvents.js';
4040

4141
import { MapLayerLoadStatus } from './state/MapLayer.js';

assets/webpack.dev.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ import common from './webpack.common.js';
33

44
export default merge(common, {
55
mode: 'development',
6-
devtool: 'eval-source-map'
6+
devtool: 'eval-source-map',
7+
experiments: {
8+
asyncWebAssembly: true,
9+
syncWebAssembly: true
10+
},
711
});

assets/webpack.prod.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ import common from './webpack.common.js';
33

44
export default merge(common, {
55
mode: 'production',
6-
devtool: 'source-map'
6+
devtool: 'source-map',
7+
experiments: {
8+
asyncWebAssembly: true,
9+
syncWebAssembly: true
10+
},
711
});

package-lock.json

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@
4747
"ol-wfs-capabilities": "^2.0.0",
4848
"playwright-ctrf-json-reporter": "^0.0.x",
4949
"postcss-lit": "^1.2.0",
50+
<<<<<<< HEAD
5051
"proj4": "^2.19.X",
52+
=======
53+
"proj4rs": "^0.1.8",
54+
>>>>>>> af1aa978e (JS: Replace proj4js by proj4rs WASM)
5155
"shpjs": "^6.1.0",
5256
"stylelint": "^16.15.x",
5357
"stylelint-config-standard": "^38.0.x",

0 commit comments

Comments
 (0)