Skip to content

Commit

Permalink
JS: using Proj4rs instead of Proj4js
Browse files Browse the repository at this point in the history
Using Rust implementation [Proj4rs](https://www.npmjs.com/package/proj4rs) of the PROJ.4 project instead of the JavaScript implementation [Proj4js](https://www.npmjs.com/package/proj4).

* The aim of Proj4rs is to provide the same functionality as the proj4js library
* The goal of Proj4rs is not to be a replacement of PROJ, but instead being a lightweight implementation of transformations from CRS to CRS that could be used in Rust and WASM environments.
  • Loading branch information
rldhont committed Oct 4, 2024
1 parent 637e6d3 commit de714c8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"jsts": "^2.11.0",
"lit-html": "^3.1.1",
"ol": "^10.2.1",
"proj4": "^2.11.0",
"shpjs": "^6.1.0",
"svg-sprite-loader": "^6.0.11",
"svgo": "^3.2.0",
Expand All @@ -28,6 +27,7 @@
"author": "3Liz",
"license": "ISC",
"dependencies": {
"ol-wfs-capabilities": "^2.0.0"
"ol-wfs-capabilities": "^2.0.0",
"proj4rs": "^0.1.5"
}
}
2 changes: 1 addition & 1 deletion assets/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import executeJSFromServer from './modules/ExecuteJSFromServer.js';

import olDep from './dependencies/ol.js';
import litHTMLDep from './dependencies/lit-html.js';
import proj4 from 'proj4';
import {proj4} from 'proj4rs/proj4.js';

lizMap.ol = olDep;
lizMap.litHTML = litHTMLDep;
Expand Down
2 changes: 1 addition & 1 deletion assets/src/modules/Lizmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { Extent as olExtent, intersects as olExtentIntersects} from 'ol/extent.j
import { Projection as olProjection, transform as olTransform, transformExtent as olTransformExtent, get as getProjection, clearAllProjections, addCommon } from 'ol/proj.js';
import { register } from 'ol/proj/proj4.js';

import proj4 from 'proj4';
import {proj4} from 'proj4rs/proj4.js';
import ProxyEvents from './ProxyEvents.js';

/**
Expand Down

0 comments on commit de714c8

Please sign in to comment.