diff --git a/.eslintignore b/.eslintignore
index 0da3e0f1cd..820d1a28fb 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,6 +1,6 @@
examples/libs/
examples/layers/
-src/ThreeExtended/
+packages/Main/src/ThreeExtended/
test/hooks.js
dist/
node_modules/
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 0006ab9edd..de8ea725cf 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -1,3 +1,5 @@
+const path = require('path');
+
module.exports = {
// Global ESLint settings
@@ -15,7 +17,15 @@ module.exports = {
},
settings: {
'import/resolver': {
- 'babel-module': {},
+ 'babel-module': {
+ alias: {
+ '@itowns/geographic': path.resolve(__dirname, 'packages/Geographic/src/Main.js'),
+ itowns: path.resolve(__dirname, 'packages/Main/src/Main.js'),
+ },
+ plugins: [
+ ['module-extension-resolver'],
+ ],
+ },
},
},
env: {
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index bcb91e0cb5..30927991f3 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -9,7 +9,6 @@ on:
- master
workflow_dispatch: {}
-
jobs:
# Build bundle, doc and check linter
@@ -79,8 +78,15 @@ jobs:
# Unit and coverage tests
unit-and-coverage-tests:
name: Unit and coverage tests
- needs: build
+ needs: [build, check-commit-message]
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ include:
+ - package: "@itowns/geographic"
+ path: "Geographic"
+ - package: "itowns"
+ path: "Main"
steps:
# Use specific Node.js version
@@ -95,17 +101,33 @@ jobs:
- name: Install packages
run: npm ci
- - name: Run unit tests
- run: npm run test-with-coverage_lcov
+ # Transpile
+ - name: transpile packages
+ run: npm run transpile
- # Code coverage
- - name: Coveralls
- if: ${{ success() }}
- uses: coverallsapp/github-action@master
+ - name: Test ${{ matrix.package }}
+ run: npm run test-with-coverage_lcov --workspace ${{ matrix.package}}
+ - name: Coveralls Parallel
+ uses: coverallsapp/github-action@v2
with:
+ format: lcov
+ base-path: ./packages/${{ matrix.path }}
+ path-to-lcov: ./packages/${{ matrix.path }}/coverage/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
+ flag-name: run-${{ matrix.package }}
+ parallel: true
-
+ # Final Code coverage
+ finish-coverage:
+ name: finish parallel test unit
+ needs: unit-and-coverage-tests
+ runs-on: ubuntu-latest
+ steps:
+ - name: Close parallel build
+ uses: coverallsapp/github-action@v2
+ with:
+ parallel-finished: true
+ github-token: ${{ secrets.GITHUB_TOKEN }}
# Functional tests
functional-tests:
name: Functional tests
@@ -139,7 +161,7 @@ jobs:
publish:
name: Publish NPM package
if: ${{ github.ref == 'refs/heads/master' }}
- needs: [unit-and-coverage-tests, functional-tests, check-commit-message]
+ needs: [finish-coverage, functional-tests]
runs-on: ubuntu-latest
permissions:
# id-token: write permission is required for npm provenance:
@@ -196,7 +218,7 @@ jobs:
deploy:
name: Deploy to itowns.github.io
if: ${{ github.ref == 'refs/heads/master' }}
- needs: [unit-and-coverage-tests, functional-tests, check-commit-message]
+ needs: [finish-coverage, functional-tests]
runs-on: ubuntu-latest
steps:
@@ -257,7 +279,7 @@ jobs:
release:
name: Release GitHub
if: ${{ github.ref == 'refs/heads/master' && startsWith( github.event.head_commit.message, 'release v' ) }}
- needs: [unit-and-coverage-tests, functional-tests, check-commit-message]
+ needs: [finish-coverage, functional-tests]
runs-on: ubuntu-latest
steps:
diff --git a/.gitignore b/.gitignore
index 5ebc710462..a9a52359a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,12 +3,12 @@
# See https://help.github.com/articles/ignoring-files/ for how to configure your environment.
# See https://github.com/github/gitignore/tree/master/Global for a list of global ignore rules.
-/node_modules/
-/dist/
+node_modules/
+**/dist/
/potree/
potree
-/lib/
+**/lib/
/docs/out/
-coverage
+**/coverage
.nyc_output/
-/src/ThreeExtended/
+**/src/ThreeExtended/
diff --git a/CODING.md b/CODING.md
index 0be99cfcf5..18ecca7757 100644
--- a/CODING.md
+++ b/CODING.md
@@ -34,6 +34,17 @@ See the [node website](https://nodejs.org) to install node and npm.
* You can then require `src/Main.js` in your code
* Test and lint changes: see test, lint and test-examples npm script
+## Monorepo structure
+
+The project is organized into the following sub-packages. This structuring is in progress.
+The roadmap is to divide the `Main` sub-module into independent functionalities.
+The final structure is exposed in this (page)[https://github.com/iTowns/itowns/issues/2414].
+
+* `Geographic` (public): The geographic package provides utilities for handling coordinates, ellipsoids, extents and rotations across different coordinate systems;
+* `Main` (public): all featues that haven't yet been moved to sub-module;
+* `Debug` (private, for the moment): iTowns debugging utilities;
+* `Widgets` (private, for the moment): Graphic user interface for iTowns;
+
## Debugging
* `babel-inline-import-loader` prevents the source map debug in browser. If you
want launch server and debug with the original source map, run : `npm run
diff --git a/Gruntfile.cjs b/Gruntfile.cjs
index 81ce8f2ddb..2d352811ac 100644
--- a/Gruntfile.cjs
+++ b/Gruntfile.cjs
@@ -4,11 +4,21 @@ module.exports = (grunt) => {
pkg: grunt.file.readJSON('package.json'),
bump: {
options: {
- files: ['package.json', 'package-lock.json', 'src/Main.js'],
+ files: ['package.json', 'package-lock.json', 'packages/Main/src/Main.js',
+ 'packages/Main/package.json',
+ 'packages/Geographic/package.json',
+ 'packages/Widgets/package.json',
+ 'packages/Debug/package.json',
+ ],
updateConfigs: [],
commit: true,
commitMessage: 'release v%VERSION%',
- commitFiles: ['package.json', 'package-lock.json', 'src/Main.js'],
+ commitFiles: ['package.json', 'package-lock.json',
+ 'packages/Main/package.json',
+ 'packages/Geographic/package.json',
+ 'packages/Widgets/package.json',
+ 'packages/Debug/package.json',
+ ],
createTag: false,
tagName: 'v%VERSION%',
tagMessage: 'Release %VERSION%.',
diff --git a/README.md b/README.md
index 0c81f9742c..e56129748f 100644
--- a/README.md
+++ b/README.md
@@ -58,10 +58,41 @@ github release page.
In your project:
+To use all iTowns features, install `itowns` package :
+
```bash
npm install --save itowns
```
+```js
+import { Coordinates } from 'itowns';
+
+const coordinates = new Coordinates('EPSG:4326', 88., 50.3, 120.3);
+
+// change projection system to pseudo mercator
+coordinates.as('EPSG:3857');
+```
+
+To import Widget features
+
+```js
+import { Navigation } from 'itowns/widgets';
+
+const viewerDiv = document.getElementById('viewerDiv');
+
+// Create a GlobeView
+const view = new itowns.GlobeView(viewerDiv);
+
+// Add navigation widget
+const navigation = new Navigation(view, {
+ position: 'bottom-right',
+ translate: { y: -40 },
+});
+```
+
+iTowns is currently moving to a monorepo organization and to a segmentation in sub-modules, allowing to import only some of itowns functionalities. Current itowns sub-modules are:
+- [@itowns/geographic](packages/Geographic/README.md): `npm install --save @itowns/geographic`
+
This package contains the ES5-compatible sources of iTowns, up to date with the latest release.
If you're using a module bundler (like wepback), you can directly write
diff --git a/babel.config.json b/babel.config.json
index 001ec6fbf8..17bedab28c 100644
--- a/babel.config.json
+++ b/babel.config.json
@@ -1,5 +1,9 @@
{
"babelrcRoots": [
- "."
+ ".",
+ "./packages/Geographic",
+ "./packages/Main",
+ "./packages/Debug",
+ "./packages/Widgets"
]
}
diff --git a/config/concurrently.mjs b/config/concurrently.mjs
new file mode 100755
index 0000000000..3d0530b9c7
--- /dev/null
+++ b/config/concurrently.mjs
@@ -0,0 +1,12 @@
+import concurrently from 'concurrently';
+
+import fs from 'fs';
+
+const pck = JSON.parse(fs.readFileSync('package.json', 'utf8'));
+const script = process.argv[2];
+
+concurrently(pck.workspaces.map(workspace => ({
+ command: `npm run ${script} -w ${workspace} --if-present`,
+ name: `${workspace}`,
+})));
+
diff --git a/config/prepare.mjs b/config/prepare.mjs
index b7e58e2786..40db9de872 100644
--- a/config/prepare.mjs
+++ b/config/prepare.mjs
@@ -1,8 +1,5 @@
import chalk from 'chalk';
-import copyfiles from 'copyfiles';
-// const chalk = require('chalk');
import { execSync } from 'child_process';
-import threeExamples from './threeExamples.mjs';
@@ -33,12 +30,3 @@ const npmVersion = execSync('npm --version', {
if (npmVersion) {
console.log(chalk.green('Npm version :', npmVersion), '\n');
}
-
-
-
-// Copy and patch THREE Examples Files
-const paths = threeExamples.filesExamples.map(f => f.replace('./', './node_modules/three/examples/jsm/'));
-
-paths.push(threeExamples.patchedPath);
-
-copyfiles(paths, { up: 4 }, () => {});
diff --git a/docs/config.json b/docs/config.json
index 2e3aa04b72..fe3fdad116 100644
--- a/docs/config.json
+++ b/docs/config.json
@@ -193,8 +193,9 @@
}
},
"source": {
- "include": [ "src", "examples/js/plugins" ],
- "exclude": [ "src/ThreeExtended" ]
+ "include": [ "examples/js/plugins", "packages" ],
+ "exclude": [ "packages/Main/src/ThreeExtended" ],
+ "excludePattern": "(^|\\/|\\\\)lib"
},
"plugins": ["plugins/markdown"]
}
diff --git a/package-lock.json b/package-lock.json
index af2abcdce7..9050648145 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5,23 +5,14 @@
"requires": true,
"packages": {
"": {
- "name": "itowns",
"version": "2.44.2",
"license": "(CECILL-B OR MIT)",
- "dependencies": {
- "@mapbox/mapbox-gl-style-spec": "^13.28.0",
- "@mapbox/vector-tile": "^2.0.3",
- "@tmcw/togeojson": "^5.8.1",
- "@tweenjs/tween.js": "^25.0.0",
- "3d-tiles-renderer": "^0.3.39",
- "brotli-compress": "^1.3.3",
- "copc": "^0.0.6",
- "earcut": "^3.0.0",
- "js-priority-queue": "^0.1.5",
- "pbf": "^4.0.1",
- "shpjs": "^6.1.0",
- "threads": "^1.7.0"
- },
+ "workspaces": [
+ "packages/Geographic",
+ "packages/Main",
+ "packages/Debug",
+ "packages/Widgets"
+ ],
"devDependencies": {
"@babel/cli": "^7.25.6",
"@babel/core": "^7.25.2",
@@ -44,8 +35,8 @@
"babel-plugin-module-resolver": "^5.0.2",
"c8": "^10.1.2",
"chalk": "^5.3.0",
- "chart.js": "^4.4.4",
"compare-func": "^2.0.0",
+ "concurrently": "^8.2.2",
"conventional-changelog-cli": "^4.1.0",
"copyfiles": "^2.4.1",
"core-js": "^3.38.1",
@@ -73,10 +64,6 @@
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.1.0"
- },
- "peerDependencies": {
- "proj4": "^2.12.1",
- "three": "^0.168.0"
}
},
"node_modules/@ampproject/remapping": {
@@ -178,6 +165,23 @@
"url": "https://opencollective.com/babel"
}
},
+ "node_modules/@babel/core/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "devOptional": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@babel/generator": {
"version": "7.25.6",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz",
@@ -295,6 +299,23 @@
"@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
}
},
+ "node_modules/@babel/helper-define-polyfill-provider/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@babel/helper-member-expression-to-functions": {
"version": "7.24.8",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.8.tgz",
@@ -2091,6 +2112,23 @@
"node": ">=6.9.0"
}
},
+ "node_modules/@babel/traverse/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "devOptional": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@babel/types": {
"version": "7.25.6",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz",
@@ -2541,6 +2579,23 @@
"url": "https://opencollective.com/eslint"
}
},
+ "node_modules/@eslint/eslintrc/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@eslint/eslintrc/node_modules/globals": {
"version": "13.24.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",
@@ -2596,6 +2651,23 @@
"node": ">=10.10.0"
}
},
+ "node_modules/@humanwhocodes/config-array/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@humanwhocodes/module-importer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
@@ -2741,6 +2813,10 @@
"node": ">=8"
}
},
+ "node_modules/@itowns/geographic": {
+ "resolved": "packages/Geographic",
+ "link": true
+ },
"node_modules/@jest/schemas": {
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz",
@@ -2927,7 +3003,6 @@
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz",
"integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==",
- "dev": true,
"license": "MIT"
},
"node_modules/@leichtgewicht/ip-codec": {
@@ -3116,6 +3191,23 @@
"node": ">=18"
}
},
+ "node_modules/@puppeteer/browsers/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@puppeteer/browsers/node_modules/semver": {
"version": "7.6.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
@@ -4046,6 +4138,23 @@
}
}
},
+ "node_modules/@typescript-eslint/parser/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@typescript-eslint/scope-manager": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.5.0.tgz",
@@ -4089,6 +4198,23 @@
}
}
},
+ "node_modules/@typescript-eslint/type-utils/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@typescript-eslint/types": {
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.5.0.tgz",
@@ -4142,6 +4268,23 @@
"balanced-match": "^1.0.0"
}
},
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
@@ -4634,6 +4777,23 @@
"node": ">= 14"
}
},
+ "node_modules/agent-base/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
@@ -5757,7 +5917,6 @@
"version": "4.4.4",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.4.tgz",
"integrity": "sha512-emICKGBABnxhMjUjlYRR12PmOXhJ2eJjEHL2/dZlWjxRAZT1D8xplLFq5M0tMQK8ja+wBS/tuVEJB5C6r7VxJA==",
- "dev": true,
"license": "MIT",
"dependencies": {
"@kurkle/color": "^0.3.0"
@@ -5997,6 +6156,76 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/concurrently": {
+ "version": "8.2.2",
+ "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-8.2.2.tgz",
+ "integrity": "sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.1.2",
+ "date-fns": "^2.30.0",
+ "lodash": "^4.17.21",
+ "rxjs": "^7.8.1",
+ "shell-quote": "^1.8.1",
+ "spawn-command": "0.0.2",
+ "supports-color": "^8.1.1",
+ "tree-kill": "^1.2.2",
+ "yargs": "^17.7.2"
+ },
+ "bin": {
+ "conc": "dist/bin/concurrently.js",
+ "concurrently": "dist/bin/concurrently.js"
+ },
+ "engines": {
+ "node": "^14.13.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/open-cli-tools/concurrently?sponsor=1"
+ }
+ },
+ "node_modules/concurrently/node_modules/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/concurrently/node_modules/chalk/node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/concurrently/node_modules/supports-color": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
+ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
+ }
+ },
"node_modules/confusing-browser-globals": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz",
@@ -6495,6 +6724,11 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/dat.gui": {
+ "version": "0.7.9",
+ "resolved": "https://registry.npmjs.org/dat.gui/-/dat.gui-0.7.9.tgz",
+ "integrity": "sha512-sCNc1OHobc+Erc1HqiswYgHdVNpSJUlk/Hz8vzOCsER7rl+oF/4+v8GXFUyCgtXpoCX6+bnmg07DedLvBLwYKQ=="
+ },
"node_modules/data-view-buffer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz",
@@ -6549,6 +6783,22 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/date-fns": {
+ "version": "2.30.0",
+ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz",
+ "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==",
+ "dev": true,
+ "dependencies": {
+ "@babel/runtime": "^7.21.0"
+ },
+ "engines": {
+ "node": ">=0.11"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/date-fns"
+ }
+ },
"node_modules/dateformat": {
"version": "4.6.3",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz",
@@ -6565,22 +6815,9 @@
"integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==",
"optional": true
},
- "node_modules/debug": {
- "version": "4.3.7",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
- "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
- "license": "MIT",
- "dependencies": {
- "ms": "^2.1.3"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
+ "node_modules/Debug": {
+ "resolved": "packages/Debug",
+ "link": true
},
"node_modules/decamelize": {
"version": "4.0.0",
@@ -7424,6 +7661,23 @@
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
+ "node_modules/eslint/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/eslint/node_modules/glob-parent": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
@@ -7700,8 +7954,25 @@
"engines": {
"node": ">= 10.17.0"
},
- "optionalDependencies": {
- "@types/yauzl": "^2.9.1"
+ "optionalDependencies": {
+ "@types/yauzl": "^2.9.1"
+ }
+ },
+ "node_modules/extract-zip/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
}
},
"node_modules/fast-deep-equal": {
@@ -8258,6 +8529,23 @@
"node": ">= 14"
}
},
+ "node_modules/get-uri/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/getobject": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.2.tgz",
@@ -8999,6 +9287,23 @@
"node": ">= 14"
}
},
+ "node_modules/http-proxy-agent/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/http-proxy-middleware": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz",
@@ -9038,6 +9343,23 @@
"node": ">= 14"
}
},
+ "node_modules/https-proxy-agent/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/hyperdyperid": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz",
@@ -9864,6 +10186,10 @@
"node": ">=8"
}
},
+ "node_modules/itowns": {
+ "resolved": "packages/Main",
+ "link": true
+ },
"node_modules/its-fine": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/its-fine/-/its-fine-1.2.5.tgz",
@@ -10751,6 +11077,23 @@
"wrap-ansi": "^7.0.0"
}
},
+ "node_modules/mocha/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/mocha/node_modules/glob": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz",
@@ -11362,6 +11705,23 @@
"node": ">= 14"
}
},
+ "node_modules/pac-proxy-agent/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/pac-resolver": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz",
@@ -11910,6 +12270,23 @@
"node": ">= 14"
}
},
+ "node_modules/proxy-agent/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/proxy-agent/node_modules/lru-cache": {
"version": "7.18.3",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz",
@@ -11998,6 +12375,23 @@
"node": ">=18"
}
},
+ "node_modules/puppeteer-core/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/q": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz",
@@ -12805,6 +13199,15 @@
"integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==",
"license": "BSD-3-Clause"
},
+ "node_modules/rxjs": {
+ "version": "7.8.1",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
+ "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
+ "dev": true,
+ "dependencies": {
+ "tslib": "^2.1.0"
+ }
+ },
"node_modules/safe-array-concat": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz",
@@ -13360,6 +13763,23 @@
"node": ">= 14"
}
},
+ "node_modules/socks-proxy-agent/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/sort-asc": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.1.0.tgz",
@@ -13419,6 +13839,12 @@
"source-map": "^0.6.0"
}
},
+ "node_modules/spawn-command": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz",
+ "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==",
+ "dev": true
+ },
"node_modules/spdx-correct": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz",
@@ -13487,6 +13913,23 @@
"wbuf": "^1.7.3"
}
},
+ "node_modules/spdy-transport/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/spdy-transport/node_modules/readable-stream": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
@@ -13512,6 +13955,23 @@
"safe-buffer": "~5.2.0"
}
},
+ "node_modules/spdy/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/split2": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz",
@@ -14036,6 +14496,22 @@
"tiny-worker": ">= 2"
}
},
+ "node_modules/threads/node_modules/debug": {
+ "version": "4.3.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
+ "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/three": {
"version": "0.168.0",
"resolved": "https://registry.npmjs.org/three/-/three-0.168.0.tgz",
@@ -14173,6 +14649,15 @@
"tslib": "2"
}
},
+ "node_modules/tree-kill": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
+ "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
+ "dev": true,
+ "bin": {
+ "tree-kill": "cli.js"
+ }
+ },
"node_modules/ts-api-utils": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz",
@@ -15058,6 +15543,10 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/Widgets": {
+ "resolved": "packages/Widgets",
+ "link": true
+ },
"node_modules/wildcard": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz",
@@ -15310,6 +15799,84 @@
"optional": true
}
}
+ },
+ "packages/Debug": {
+ "version": "2.44.2",
+ "license": "(CECILL-B OR MIT)",
+ "dependencies": {
+ "@tweenjs/tween.js": "^25.0.0",
+ "chart.js": "^4.4.4",
+ "dat.gui": "^0.7.9",
+ "itowns": "^2.44.2"
+ },
+ "peerDependencies": {
+ "three": "^0.168.0"
+ }
+ },
+ "packages/Geodesy": {
+ "name": "@itowns/geographic",
+ "version": "2.44.2",
+ "extraneous": true,
+ "license": "(CECILL-B OR MIT)",
+ "peerDependencies": {
+ "proj4": "^2.12.1",
+ "three": "^0.168.0"
+ }
+ },
+ "packages/Geographic": {
+ "name": "@itowns/geographic",
+ "version": "2.44.2",
+ "license": "(CECILL-B OR MIT)",
+ "peerDependencies": {
+ "proj4": "^2.12.1",
+ "three": "^0.168.0"
+ }
+ },
+ "packages/Main": {
+ "name": "itowns",
+ "version": "2.44.2",
+ "hasInstallScript": true,
+ "license": "(CECILL-B OR MIT)",
+ "dependencies": {
+ "@itowns/geographic": "^2.44.2",
+ "@mapbox/mapbox-gl-style-spec": "^13.28.0",
+ "@mapbox/vector-tile": "^2.0.3",
+ "@tmcw/togeojson": "^5.8.1",
+ "@tweenjs/tween.js": "^25.0.0",
+ "3d-tiles-renderer": "^0.3.39",
+ "brotli-compress": "^1.3.3",
+ "copc": "^0.0.6",
+ "earcut": "^3.0.0",
+ "js-priority-queue": "^0.1.5",
+ "pbf": "^4.0.1",
+ "shpjs": "^6.1.0",
+ "threads": "^1.7.0"
+ },
+ "devDependencies": {
+ "chalk": "^5.3.0",
+ "copyfiles": "^2.4.1"
+ },
+ "peerDependencies": {
+ "proj4": "^2.12.1",
+ "three": "^0.168.0"
+ }
+ },
+ "packages/Widget": {
+ "version": "2.44.2",
+ "extraneous": true,
+ "license": "(CECILL-B OR MIT)",
+ "dependencies": {
+ "@itowns/geographic": "^2.44.2",
+ "itowns": "^2.44.2"
+ }
+ },
+ "packages/Widgets": {
+ "version": "2.44.2",
+ "license": "(CECILL-B OR MIT)",
+ "dependencies": {
+ "@itowns/geographic": "^2.44.2",
+ "itowns": "^2.44.2"
+ }
}
}
}
diff --git a/package.json b/package.json
index 3a7a448920..a0b9a058dc 100644
--- a/package.json
+++ b/package.json
@@ -1,43 +1,48 @@
{
- "name": "itowns",
+ "private": true,
"version": "2.44.2",
"description": "A JS/WebGL framework for 3D geospatial data visualization",
"type": "module",
- "main": "lib/Main.js",
- "exports": {
- ".": "./lib/Main.js",
- "./widgets": "./lib/Utils/gui/Main.js"
- },
+ "workspaces": [
+ "packages/Geographic",
+ "packages/Main",
+ "packages/Debug",
+ "packages/Widgets"
+ ],
"scripts": {
- "lint": "eslint \"src/**/*.{js,ts,tsx}\" \"test/**/*.js\" \"examples/**/*.js\" \"docs/*.js\"",
+ "lint": "npm run lint --workspaces && eslint \"examples/**/*.js\" \"docs/*.js\"",
"doc": "jsdoc --readme docs/HOMEPAGE.md -c docs/config.json",
"doclint": "npm run doc -- -t templates/silent",
- "test": "npm run lint -- --max-warnings=0 && npm run build && npm run test-with-coverage && npm run test-functional",
- "test-dev": "npm run lint -- --max-warnings=0 && npm run build-dev && npm run test-with-coverage && npm run test-functional",
- "test-unit": "npm run base-test-unit test/unit",
- "test-functional": "mocha -t 100000 --require test/hooks_functional.js --recursive test/functional",
- "test-with-coverage": "c8 -n src -r html cross-env npm run test-unit",
- "test-with-coverage_lcov": "c8 -n src --reporter=lcov cross-env npm run test-unit",
- "base-test-unit": "cross-env BABEL_DISABLE_CACHE=1 mocha --file test/unit/bootstrap.js --import=./config/babel-register/register.mjs",
- "build": "cross-env NODE_ENV=production webpack",
+ "test": "npm run transpile && npm run test-with-coverage && npm run build && npm run test-functional",
+ "test-dev": "npm run test-unit && npm run build-dev && npm run test-functional",
+ "test-unit": "npm run test-unit --workspaces --if-present",
+ "test-functional": "npm run build && mocha -t 100000 --require test/hooks_functional.js --recursive test/functional",
+ "test-with-coverage": "npm run test-with-coverage --workspaces --if-present",
+ "test-with-coverage_lcov": "npm run test-with-coverage_lcov --workspaces --if-present && c8 report --reporter=lcov",
+ "build": "npm run transpile && cross-env NODE_ENV=production webpack",
"build-dev": "cross-env NODE_ENV=development webpack",
- "transpile": "cross-env BABEL_DISABLE_CACHE=1 babel src --out-dir lib --extensions .js,.ts",
+ "transpile": "npm run transpile --workspaces",
"start": "cross-env NODE_ENV=development webpack serve",
"start-https": "cross-env NODE_ENV=development webpack serve --https",
"debug": "cross-env noInline=true npm start",
"prepublishOnly": "npm run build && npm run transpile",
- "prepare": "cross-env NO_UPDATE_NOTIFIER=true node ./config/prepare.mjs && node ./config/replace.config.mjs",
- "watch": "npm run transpile -- --watch",
+ "prepare": "cross-env NO_UPDATE_NOTIFIER=true node ./config/prepare.mjs && npm run prepare --workspaces --if-present",
+ "watch": "node ./config/concurrently.mjs watch",
"changelog": "conventional-changelog -n ./config/conventionalChangelog/config.cjs -i changelog.md -s",
- "bump": "if [ -z $npm_config_level ]; then grunt bump:minor; else grunt bump:$npm_config_level; fi && npm run changelog && npm install && git add -A && git commit --amend --no-edit",
- "publish-next": "npm version prerelease --preid next && npm publish --access public --tag=next --provenance",
- "publish-latest": "npm publish --access public --tag=latest --provenance"
+ "bump": "if [ -z $npm_config_level ]; then grunt bump:minor; else grunt bump:$npm_config_level; fi && npm run changelog && npm run update-packages && npm install && git add -A && git commit --amend --no-edit",
+ "publish-next": "npm run publish-next -workspaces --if-present && npm publish --access public --tag=next --workspaces --provenance",
+ "publish-latest": "npm publish --access public --tag=latest --provenance --workspaces",
+ "update-packages": "npm run update-package -workspaces --if-present"
},
"c8": {
"exclude": [
+ "**/test/**",
+ "**/lib/**",
"**/*ThreeExtended",
"**/*src/Utils/placeObjectOnGround.js",
- "**/*src/Parser/deprecated/LegacyGLTFLoader.js"
+ "**/*src/Parser/deprecated/LegacyGLTFLoader.js",
+ "**/packages/Widgets/",
+ "**/packages/Debug/"
]
},
"files": [
@@ -56,24 +61,6 @@
"url": "https://github.com/iTowns/itowns/issues"
},
"homepage": "https://itowns.github.io/",
- "dependencies": {
- "@mapbox/mapbox-gl-style-spec": "^13.28.0",
- "@mapbox/vector-tile": "^2.0.3",
- "@tmcw/togeojson": "^5.8.1",
- "@tweenjs/tween.js": "^25.0.0",
- "3d-tiles-renderer": "^0.3.39",
- "brotli-compress": "^1.3.3",
- "copc": "^0.0.6",
- "earcut": "^3.0.0",
- "js-priority-queue": "^0.1.5",
- "pbf": "^4.0.1",
- "shpjs": "^6.1.0",
- "threads": "^1.7.0"
- },
- "peerDependencies": {
- "proj4": "^2.12.1",
- "three": "^0.168.0"
- },
"devDependencies": {
"@babel/cli": "^7.25.6",
"@babel/core": "^7.25.2",
@@ -96,8 +83,8 @@
"babel-plugin-module-resolver": "^5.0.2",
"c8": "^10.1.2",
"chalk": "^5.3.0",
- "chart.js": "^4.4.4",
"compare-func": "^2.0.0",
+ "concurrently": "^8.2.2",
"conventional-changelog-cli": "^4.1.0",
"copyfiles": "^2.4.1",
"core-js": "^3.38.1",
diff --git a/packages/Debug/.babelrc b/packages/Debug/.babelrc
new file mode 100644
index 0000000000..37a7182f87
--- /dev/null
+++ b/packages/Debug/.babelrc
@@ -0,0 +1,25 @@
+{
+ "presets": [
+ ["@babel/preset-typescript"],
+ ["@babel/preset-env", {
+ "targets": {
+ "browsers": "defaults and supports webgl2"
+ },
+ "modules": false
+ }]
+ ],
+ "plugins": [
+ ["module-resolver", {
+ "cwd": "packagejson",
+ "root": ["./src"],
+ "extensions": [".js", ".ts", ".tsx"]
+ }],
+ ["module-extension-resolver", {
+ "srcExtensions": [".ts", ".js"]
+ }],
+ ["@babel/plugin-transform-runtime", {
+ "regenerator": false
+ }],
+ ["minify-dead-code-elimination"]
+ ]
+}
diff --git a/packages/Debug/.eslintrc.cjs b/packages/Debug/.eslintrc.cjs
new file mode 100644
index 0000000000..9e9e3440e3
--- /dev/null
+++ b/packages/Debug/.eslintrc.cjs
@@ -0,0 +1,7 @@
+
+module.exports = {
+ extends: [
+ '../../.eslintrc.cjs',
+ ],
+};
+
diff --git a/packages/Debug/README.md b/packages/Debug/README.md
new file mode 100644
index 0000000000..cf61f418f9
--- /dev/null
+++ b/packages/Debug/README.md
@@ -0,0 +1,33 @@
+## iTowns Debug (private, for the moment)
+
+iTowns debugging utilities.
+
+## Getting started
+
+For the moment, The debug features aren't exposed in `itowns` module but in bundle.
+We provide a debug bundle you can directly include in your html files:
+
+```html
+
+
+
+
+```
+
diff --git a/packages/Debug/package.json b/packages/Debug/package.json
new file mode 100644
index 0000000000..a6fd50fb83
--- /dev/null
+++ b/packages/Debug/package.json
@@ -0,0 +1,37 @@
+{
+ "private": true,
+ "version": "2.44.2",
+ "type": "module",
+ "main": "lib/Main.js",
+ "exports": {
+ ".": "./lib/Main.js"
+ },
+ "scripts": {
+ "lint": "eslint \"src/**/*.{js,ts,tsx}\"",
+ "transpile": "cross-env BABEL_DISABLE_CACHE=1 babel src --out-dir lib --extensions .js,.ts",
+ "watch": "npm run transpile -- --watch"
+ },
+ "files": [
+ "*.md",
+ "src",
+ "lib"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/iTowns/itowns.git"
+ },
+ "license": "(CECILL-B OR MIT)",
+ "bugs": {
+ "url": "https://github.com/itowns/itowns/issues"
+ },
+ "homepage": "https://itowns.github.io/",
+ "dependencies": {
+ "chart.js": "^4.4.4",
+ "dat.gui": "^0.7.9",
+ "itowns": "^2.44.2",
+ "@tweenjs/tween.js": "^25.0.0"
+ },
+ "peerDependencies": {
+ "three": "^0.168.0"
+ }
+}
diff --git a/utils/debug/3dTilesDebug.js b/packages/Debug/src/3dTilesDebug.js
similarity index 95%
rename from utils/debug/3dTilesDebug.js
rename to packages/Debug/src/3dTilesDebug.js
index 3081c193da..b21db437e7 100644
--- a/utils/debug/3dTilesDebug.js
+++ b/packages/Debug/src/3dTilesDebug.js
@@ -1,8 +1,5 @@
import * as THREE from 'three';
-import View from 'Core/View';
-import GeometryLayer from 'Layer/GeometryLayer';
-import { C3DTilesBoundingVolumeTypes } from 'Core/3DTiles/C3DTilesEnums';
-import { PNTS_MODE, PNTS_SHAPE, PNTS_SIZE_MODE } from 'Renderer/PointsMaterial';
+import { View, GeometryLayer, C3DTilesBoundingVolumeTypes, PNTS_MODE, PNTS_SHAPE, PNTS_SIZE_MODE } from 'itowns';
import GeometryDebug from './GeometryDebug';
const bboxMesh = new THREE.Mesh();
diff --git a/utils/debug/Debug.js b/packages/Debug/src/Debug.js
similarity index 98%
rename from utils/debug/Debug.js
rename to packages/Debug/src/Debug.js
index 97420a456b..91b413f18a 100644
--- a/utils/debug/Debug.js
+++ b/packages/Debug/src/Debug.js
@@ -1,7 +1,6 @@
import { CameraHelper, Color, Vector3 } from 'three';
-import Coordinates from 'Core/Geographic/Coordinates';
-import { MAIN_LOOP_EVENTS } from 'Core/MainLoop';
-import OBB from 'Renderer/OBB';
+import { Coordinates } from '@itowns/geographic';
+import { MAIN_LOOP_EVENTS, OBB } from 'itowns';
import * as THREE from 'three';
import ThreeStatsChart from './charts/ThreeStatsChart';
import { backgroundChartDiv, color_blue } from './charts/ChartConfig';
diff --git a/utils/debug/GeometryDebug.js b/packages/Debug/src/GeometryDebug.js
similarity index 100%
rename from utils/debug/GeometryDebug.js
rename to packages/Debug/src/GeometryDebug.js
diff --git a/packages/Debug/src/GuiTools.js b/packages/Debug/src/GuiTools.js
new file mode 100644
index 0000000000..fc75cd228f
--- /dev/null
+++ b/packages/Debug/src/GuiTools.js
@@ -0,0 +1,184 @@
+import * as itowns from 'itowns';
+import * as dat from 'dat.gui';
+
+dat.GUI.prototype.removeFolder = function removeFolder(name) {
+ const folder = this.__folders[name];
+ if (!folder) {
+ return;
+ }
+ folder.close();
+ this.__ul.removeChild(folder.domElement.parentNode);
+ delete this.__folders[name];
+ this.onResize();
+};
+
+dat.GUI.prototype.colorLayerFolder = function colorLayerFolder(name, value) {
+ const folder = this.__folders[name];
+ if (!folder) {
+ return;
+ }
+ const title = folder.__ul.getElementsByClassName('title')[0];
+
+ if (title.style) {
+ title.style.background = value;
+ }
+};
+
+dat.GUI.prototype.hasFolder = function hasFolder(name) {
+ return this.__folders[name];
+};
+
+function GuiTools(domId, view, w) {
+ if (view) {
+ const width = w || 245;
+ const element = document.createElement('div');
+ element.id = 'menuDiv';
+ this.gui = new dat.GUI({ autoPlace: false, width });
+ element.appendChild(this.gui.domElement);
+ document.body.appendChild(element);
+ this.colorGui = this.gui.addFolder('Color Layers');
+ this.elevationGui = this.gui.addFolder('Elevation Layers');
+ this.geoidGui = this.gui.addFolder('Geoid Layers');
+ this.elevationGui.hide();
+ this.colorGui.hide();
+ this.geoidGui.hide();
+ this.view = view;
+ view.addEventListener('layers-order-changed', (() => {
+ let i;
+ const colorLayers = view.getLayers(l => l.isColorLayer);
+ for (i = 0; i < colorLayers.length; i++) {
+ this.removeLayersGUI(colorLayers[i].id);
+ }
+
+ this.addImageryLayersGUI(colorLayers);
+ }));
+ }
+}
+
+GuiTools.prototype.addLayerGUI = function fnAddLayerGUI(layer) {
+ if (layer.isColorLayer) {
+ this.addImageryLayerGUI(layer);
+ } else if (layer.isElevationLayer) {
+ this.addElevationLayerGUI(layer);
+ } else if (layer.isGeoidLayer) {
+ this.addGeoidLayerGUI(layer);
+ }
+};
+
+GuiTools.prototype.addLayersGUI = function fnAddLayersGUI() {
+ function filterColor(l) { return l.isColorLayer; }
+ function filterElevation(l) { return l.isElevationLayer; }
+ this.addImageryLayersGUI(this.view.getLayers(filterColor));
+ this.addElevationLayersGUI(this.view.getLayers(filterElevation));
+ // eslint-disable-next-line no-console
+ console.info('menu initialized');
+};
+
+GuiTools.prototype.addImageryLayerGUI = function addImageryLayerGUI(layer) {
+ if (this.colorGui.hasFolder(layer.id)) { return; }
+ this.colorGui.show();
+ const folder = this.colorGui.addFolder(layer.id);
+ folder.add({ visible: layer.visible }, 'visible').onChange(((value) => {
+ layer.visible = value;
+ this.view.notifyChange(layer);
+ }));
+ folder.add({ opacity: layer.opacity }, 'opacity', 0.0, 1.0, 0.01).onChange(((value) => {
+ layer.opacity = value;
+ this.view.notifyChange(layer);
+ }));
+ folder.add({ frozen: layer.frozen }, 'frozen').onChange(((value) => {
+ layer.frozen = value;
+ this.view.notifyChange(layer);
+ }));
+};
+
+GuiTools.prototype.addElevationLayerGUI = function addElevationLayerGUI(layer) {
+ if (this.elevationGui.hasFolder(layer.id)) { return; }
+ this.elevationGui.show();
+ const folder = this.elevationGui.addFolder(layer.id);
+ folder.add({ frozen: layer.frozen }, 'frozen').onChange((value) => {
+ layer.frozen = value;
+ });
+ folder.add({ scale: layer.scale }, 'scale').min(1.0).max(20000.0).onChange(((value) => {
+ layer.scale = value;
+ this.view.notifyChange(layer);
+ }));
+};
+
+GuiTools.prototype.addGeoidLayerGUI = function addGeoidLayerGUI(layer) {
+ if (this.geoidGui.hasFolder(layer.id)) { return; }
+ this.geoidGui.show();
+ const folder = this.geoidGui.addFolder(layer.id);
+ folder.add({ frozen: layer.frozen }, 'frozen').onChange((value) => {
+ layer.frozen = value;
+ });
+ folder.add({ visible: layer.visible }, 'visible').onChange(((value) => {
+ layer.visible = value;
+ this.view.notifyChange(layer);
+ }));
+};
+
+GuiTools.prototype.addImageryLayersGUI = function addImageryLayersGUI(layers) {
+ let i;
+ const seq = itowns.ImageryLayers.getColorLayersIdOrderedBySequence(layers);
+ const sortedLayers = layers.sort((a, b) => seq.indexOf(a.id) < seq.indexOf(b.id));
+ for (i = 0; i < sortedLayers.length; i++) {
+ this.addImageryLayerGUI(sortedLayers[i]);
+ }
+};
+
+GuiTools.prototype.addElevationLayersGUI = function addElevationLayersGUI(layers) {
+ let i;
+ for (i = 0; i < layers.length; i++) {
+ this.addElevationLayerGUI(layers[i]);
+ }
+};
+
+GuiTools.prototype.removeLayersGUI = function removeLayersGUI(nameLayer) {
+ this.colorGui.removeFolder(nameLayer);
+};
+
+GuiTools.prototype.addGUI = function addGUI(name, value, callback) {
+ this[name] = value;
+ return this.gui.add(this, name).onChange(callback);
+};
+
+GuiTools.prototype.colorLayerFolder = function colorLayerFolder(nameLayer, value) {
+ this.colorGui.colorLayerFolder(nameLayer, value);
+};
+
+// Recursive function that creates an HTML List from a javascript
+// object
+// eslint-disable-next-line no-unused-vars
+function createHTMLListFromObject(jsObject) {
+ const list = document.createElement('ul');
+ // Change the padding (top: 0, right:0, bottom:0 and left:1.5)
+ list.style.padding = '0 0 0 1.5rem';
+ // For each property of the object
+ Object.keys(jsObject).forEach((property) => {
+ // create item
+ const item = document.createElement('li');
+ // append property name
+ item.appendChild(document.createTextNode(property));
+
+ if (jsObject[property] === null) {
+ jsObject[property] = 'null';
+ }
+
+ if (typeof jsObject[property] === 'object') {
+ // if property value is an object, then recurse to
+ // create a list from it
+ // eslint-disable-next-line no-unused-vars
+ item.appendChild(createHTMLListFromObject(jsObject[property]));
+ } else {
+ // else append the value of the property to the item
+ item.appendChild(document.createTextNode(': '));
+ item.appendChild(
+ document.createTextNode(jsObject[property]));
+ }
+ list.appendChild(item);
+ });
+ return list;
+}
+
+export default GuiTools;
diff --git a/packages/Debug/src/Main.js b/packages/Debug/src/Main.js
new file mode 100644
index 0000000000..fd694f0645
--- /dev/null
+++ b/packages/Debug/src/Main.js
@@ -0,0 +1,7 @@
+export { default as Debug } from 'Debug';
+export { default as PointCloudDebug } from 'PointCloudDebug';
+export { default as createTileDebugUI } from 'TileDebug';
+export { default as create3dTilesDebugUI } from '3dTilesDebug';
+export { default as createOGC3DTilesDebugUI } from 'OGC3DTilesDebug';
+export { default as GeometryDebug } from 'GeometryDebug';
+export { default as GuiTools } from 'GuiTools';
diff --git a/utils/debug/OBBHelper.js b/packages/Debug/src/OBBHelper.js
similarity index 100%
rename from utils/debug/OBBHelper.js
rename to packages/Debug/src/OBBHelper.js
diff --git a/utils/debug/OGC3DTilesDebug.js b/packages/Debug/src/OGC3DTilesDebug.js
similarity index 97%
rename from utils/debug/OGC3DTilesDebug.js
rename to packages/Debug/src/OGC3DTilesDebug.js
index 7963f4314c..f528a46b06 100644
--- a/utils/debug/OGC3DTilesDebug.js
+++ b/packages/Debug/src/OGC3DTilesDebug.js
@@ -1,6 +1,6 @@
import { DebugTilesPlugin } from '3d-tiles-renderer';
-import { PNTS_MODE, PNTS_SHAPE, PNTS_SIZE_MODE } from 'Renderer/PointsMaterial';
+import { PNTS_MODE, PNTS_SHAPE, PNTS_SIZE_MODE } from 'itowns';
import GeometryDebug from './GeometryDebug';
export default function createOGC3DTilesDebugUI(datDebugTool, view, _3dTileslayer) {
diff --git a/utils/debug/PointCloudDebug.js b/packages/Debug/src/PointCloudDebug.js
similarity index 99%
rename from utils/debug/PointCloudDebug.js
rename to packages/Debug/src/PointCloudDebug.js
index b2a963ad9d..b497cc6204 100644
--- a/utils/debug/PointCloudDebug.js
+++ b/packages/Debug/src/PointCloudDebug.js
@@ -1,4 +1,4 @@
-import { PNTS_MODE, PNTS_SHAPE, PNTS_SIZE_MODE } from 'Renderer/PointsMaterial';
+import { PNTS_MODE, PNTS_SHAPE, PNTS_SIZE_MODE } from 'itowns';
function getController(gui, name) {
let controller = null;
diff --git a/utils/debug/TileDebug.js b/packages/Debug/src/TileDebug.js
similarity index 98%
rename from utils/debug/TileDebug.js
rename to packages/Debug/src/TileDebug.js
index 1866698264..77852c129d 100644
--- a/utils/debug/TileDebug.js
+++ b/packages/Debug/src/TileDebug.js
@@ -1,8 +1,6 @@
import * as THREE from 'three';
import TWEEN from '@tweenjs/tween.js';
-import GeometryLayer from 'Layer/GeometryLayer';
-import { MAIN_LOOP_EVENTS } from 'Core/MainLoop';
-import ObjectRemovalHelper from 'Process/ObjectRemovalHelper';
+import { MAIN_LOOP_EVENTS, GeometryLayer, ObjectRemovalHelper } from 'itowns';
import TileObjectChart from './charts/TileObjectChart';
import TileVisibilityChart from './charts/TileVisibilityChart';
import GeometryDebug from './GeometryDebug';
diff --git a/utils/debug/charts/ChartConfig.js b/packages/Debug/src/charts/ChartConfig.js
similarity index 100%
rename from utils/debug/charts/ChartConfig.js
rename to packages/Debug/src/charts/ChartConfig.js
diff --git a/utils/debug/charts/ThreeStatsChart.js b/packages/Debug/src/charts/ThreeStatsChart.js
similarity index 100%
rename from utils/debug/charts/ThreeStatsChart.js
rename to packages/Debug/src/charts/ThreeStatsChart.js
diff --git a/utils/debug/charts/TileObjectChart.js b/packages/Debug/src/charts/TileObjectChart.js
similarity index 100%
rename from utils/debug/charts/TileObjectChart.js
rename to packages/Debug/src/charts/TileObjectChart.js
diff --git a/utils/debug/charts/TileVisibilityChart.js b/packages/Debug/src/charts/TileVisibilityChart.js
similarity index 100%
rename from utils/debug/charts/TileVisibilityChart.js
rename to packages/Debug/src/charts/TileVisibilityChart.js
diff --git a/packages/Debug/tsconfig.json b/packages/Debug/tsconfig.json
new file mode 100644
index 0000000000..8c6936f80e
--- /dev/null
+++ b/packages/Debug/tsconfig.json
@@ -0,0 +1,10 @@
+{
+ "extends": "../../tsconfig.json",
+ "include": [ "src/Main.js" ],
+ "exclude": [ "node_modules", "lib" ],
+ "compilerOptions": {
+ "paths": {
+ "*": [ "src/*" ]
+ },
+ }
+}
diff --git a/packages/Geographic/.babelrc b/packages/Geographic/.babelrc
new file mode 100644
index 0000000000..160b1d5ea3
--- /dev/null
+++ b/packages/Geographic/.babelrc
@@ -0,0 +1,21 @@
+{
+ "presets": [
+ ["@babel/preset-typescript"],
+ ["@babel/preset-env", {
+ "targets": {
+ "browsers": "defaults and supports webgl2"
+ },
+ "modules": false
+ }]
+ ],
+ "plugins": [
+ ["module-resolver", {
+ "cwd": "packagejson",
+ "root": ["./src"],
+ "extensions": [".js", ".ts", ".tsx"]
+ }],
+ ["module-extension-resolver", {
+ "srcExtensions": [".ts", ".js"]
+ }],
+ ]
+}
diff --git a/packages/Geographic/.eslintrc.cjs b/packages/Geographic/.eslintrc.cjs
new file mode 100644
index 0000000000..9e9e3440e3
--- /dev/null
+++ b/packages/Geographic/.eslintrc.cjs
@@ -0,0 +1,7 @@
+
+module.exports = {
+ extends: [
+ '../../.eslintrc.cjs',
+ ],
+};
+
diff --git a/packages/Geographic/README.md b/packages/Geographic/README.md
new file mode 100644
index 0000000000..ae3d0dc78b
--- /dev/null
+++ b/packages/Geographic/README.md
@@ -0,0 +1,67 @@
+## iTowns Geographic
+
+The geographic package provides utilities for handling coordinates, ellipsoids, extents and rotations across different coordinate systems.
+
+* [Coordinates](http://www.itowns-project.org/itowns/docs/#api/Geographic/Coordinates) : A Coordinates object (geodetic datum), defined by a [crs] and three values.
+* [Coordinates stars] : get sun position, azimuth, ascention, ecliptic longitude and declination from date.
+* [Coordinate Reference System](http://www.itowns-project.org/itowns/docs/#api/Geographic/CRS) : This module provides basic methods to manipulate a CRS (as a string). to explore available coordinates systems and use their **proj4js** definition to define them in itowns with `proj4.defs(crs, proj4def)`.
+* Ellipsoid : A representation of an [ellipsoid](https://en.wikipedia.org/wiki/Ellipsoid) and useful computation methods (geodetic normal, etc.)
+* Ellipsoid Size: The length of the earth ellispoid semi-axes.
+* [Extent](http://www.itowns-project.org/itowns/docs/#api/Geographic/Extent) : Extent is geographical bounding rectangle defined by a crs and 4 limits: west, east, south and north .
+* [OrientationUtils](http://www.itowns-project.org/itowns/docs/#api/Geographic/OrientationUtils) : utilities to compute a rotation quaternion from various rotation conventions, including between different crs.
+
+# Install
+
+`npm install --save @itowns/geographic`
+
+# Getting started
+
+```js
+import { Coordinates, Extent, CRS } from '@itowns/geographic';
+
+const coordinates = new Coordinates('EPSG:4326', 88.002445, 50.336522, 120.32201);
+const extent = new Extent('EPSG:4326', 88.002445, 50.336522, 22.021, 50.302548);
+
+// change projection system to pseudo mercator
+
+coordinates.as('EPSG:3857');
+extent.as('EPSG:3857');
+
+// change projection system to EPSG:2154
+
+// defs EPSG:2154 crs (visit epsg.io to get the proj4js definition of a crs)
+CRS.defs('EPSG:2154','+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs');
+
+coordinates.as('EPSG:2154');
+
+```
+
+## OrientationUtils example
+
+In geodesy, attitude refers to the orientation of a geodetic instrument or platform in three-dimensional space. It is defined by the angles that describe how an instrument or a vehicle (like a satellite or aircraft) is positioned relative to a reference coordinate system, typically the Earth's surface or a local tangent plane.
+
+```js
+// Compute the rotation around the point of origin from a frame aligned with Lambert93 axes (epsg:2154),
+// to the geocentric frame (epsg:4978)
+
+quat_crs2crs = OrientationUtils.quaternionFromCRSToCRS("EPSG:2154", "EPSG:4978")(origin);
+
+// Compute the rotation of a sensor platform defined by its attitude
+
+const attitude = {
+ // Rotation around the longitudinal axis of the object (front-to-back axis), tilting the object sideways.
+ Roll: 0.0,
+ // Rotation around the lateral axis (side-to-side axis), moving the nose or front up or down.
+ Pitch: Math.PI * 0.2,
+ // Rotation around the vertical axis (top-to-bottom axis), changing the direction the object is facing horizontally.
+ Yaw: Math.PI * 0.5,
+}
+
+quat_attitude = OrientationUtils.quaternionFromAttitude(attitude);
+
+// Compute the rotation from the sensor platform frame to the geocentric frame
+
+quat = quat_crs2crs.multiply(quat_attitude);
+```
+
+Visit the iTowns [documentation](http://www.itowns-project.org/itowns/docs/#home) for more information.
diff --git a/packages/Geographic/package.json b/packages/Geographic/package.json
new file mode 100644
index 0000000000..86df9b4fc3
--- /dev/null
+++ b/packages/Geographic/package.json
@@ -0,0 +1,39 @@
+{
+ "name": "@itowns/geographic",
+ "version": "2.44.2",
+ "description": "Geodesy",
+ "type": "module",
+ "main": "lib/Main.js",
+ "exports": {
+ ".": "./lib/Main.js"
+ },
+ "scripts": {
+ "build": "",
+ "lint": "eslint \"src/**/*.{js,ts,tsx}\" \"test/**/*.js\"",
+ "transpile": "cross-env BABEL_DISABLE_CACHE=1 babel src --out-dir lib --extensions .js,.ts",
+ "test-unit": "npm run base-test-unit test/unit",
+ "base-test-unit": "cross-env BABEL_DISABLE_CACHE=1 mocha --import=../../config/babel-register/register.mjs",
+ "test-with-coverage": "c8 -n src -r html cross-env npm run test-unit",
+ "test-with-coverage_lcov": "c8 -n src --reporter=lcov cross-env npm run test-unit",
+ "watch": "npm run transpile -- --watch",
+ "publish-next": "npm version prerelease --preid next"
+ },
+ "files": [
+ "*.md",
+ "src",
+ "lib"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/iTowns/itowns.git"
+ },
+ "license": "(CECILL-B OR MIT)",
+ "bugs": {
+ "url": "https://github.com/itowns/itowns/issues"
+ },
+ "peerDependencies": {
+ "proj4": "^2.12.1",
+ "three": "^0.168.0"
+ },
+ "homepage": "https://itowns.github.io/"
+}
diff --git a/src/Core/Geographic/CoordStars.js b/packages/Geographic/src/CoordStars.js
similarity index 98%
rename from src/Core/Geographic/CoordStars.js
rename to packages/Geographic/src/CoordStars.js
index 34066a728f..593b4e4243 100644
--- a/src/Core/Geographic/CoordStars.js
+++ b/packages/Geographic/src/CoordStars.js
@@ -3,7 +3,7 @@
* Class: CoordStars
* Description: get coord of stars like earth...
*/
-import Coordinates from 'Core/Geographic/Coordinates';
+import Coordinates from 'Coordinates';
const CoordStars = {
diff --git a/src/Core/Geographic/Coordinates.js b/packages/Geographic/src/Coordinates.js
similarity index 99%
rename from src/Core/Geographic/Coordinates.js
rename to packages/Geographic/src/Coordinates.js
index d0934066ea..a10e949e83 100644
--- a/src/Core/Geographic/Coordinates.js
+++ b/packages/Geographic/src/Coordinates.js
@@ -1,7 +1,7 @@
import * as THREE from 'three';
import proj4 from 'proj4';
-import * as CRS from 'Core/Geographic/Crs';
-import Ellipsoid from 'Core/Math/Ellipsoid';
+import Ellipsoid from 'Ellipsoid';
+import * as CRS from './Crs';
proj4.defs('EPSG:4978', '+proj=geocent +datum=WGS84 +units=m +no_defs');
diff --git a/src/Core/Geographic/Crs.ts b/packages/Geographic/src/Crs.ts
similarity index 100%
rename from src/Core/Geographic/Crs.ts
rename to packages/Geographic/src/Crs.ts
diff --git a/src/Core/Math/Ellipsoid.js b/packages/Geographic/src/Ellipsoid.js
similarity index 99%
rename from src/Core/Math/Ellipsoid.js
rename to packages/Geographic/src/Ellipsoid.js
index 8c0ea17221..aae3063aad 100644
--- a/src/Core/Math/Ellipsoid.js
+++ b/packages/Geographic/src/Ellipsoid.js
@@ -1,6 +1,6 @@
import * as THREE from 'three';
import proj4 from 'proj4';
-import Coordinates from 'Core/Geographic/Coordinates';
+import Coordinates from 'Coordinates';
export const ellipsoidSizes = new THREE.Vector3(
proj4.WGS84.a,
diff --git a/src/Core/Geographic/Extent.js b/packages/Geographic/src/Extent.js
similarity index 100%
rename from src/Core/Geographic/Extent.js
rename to packages/Geographic/src/Extent.js
index 39c9ddf1ab..ec89d94814 100644
--- a/src/Core/Geographic/Extent.js
+++ b/packages/Geographic/src/Extent.js
@@ -1,6 +1,6 @@
import * as THREE from 'three';
-import * as CRS from './Crs';
import Coordinates from './Coordinates';
+import * as CRS from './Crs';
/**
* Extent is a SIG-area (so 2D)
diff --git a/packages/Geographic/src/Main.js b/packages/Geographic/src/Main.js
new file mode 100644
index 0000000000..5eb45d829f
--- /dev/null
+++ b/packages/Geographic/src/Main.js
@@ -0,0 +1,8 @@
+// Geodesic tools
+export { default as Extent } from 'Extent';
+export { default as Coordinates } from 'Coordinates';
+export * as CRS from 'Crs';
+export { default as CoordStars } from 'CoordStars';
+export { default as OrientationUtils } from 'OrientationUtils';
+export { default as Ellipsoid, ellipsoidSizes } from 'Ellipsoid';
+
diff --git a/src/Utils/OrientationUtils.js b/packages/Geographic/src/OrientationUtils.js
similarity index 99%
rename from src/Utils/OrientationUtils.js
rename to packages/Geographic/src/OrientationUtils.js
index 55a9b63c00..1687f51005 100644
--- a/src/Utils/OrientationUtils.js
+++ b/packages/Geographic/src/OrientationUtils.js
@@ -1,6 +1,6 @@
import * as THREE from 'three';
import proj4 from 'proj4';
-import Coordinates from '../Core/Geographic/Coordinates';
+import Coordinates from 'Coordinates';
const DEG2RAD = THREE.MathUtils.DEG2RAD;
const matrix = new THREE.Matrix4();
diff --git a/packages/Geographic/test/.eslintrc.cjs b/packages/Geographic/test/.eslintrc.cjs
new file mode 100644
index 0000000000..28b3eb003d
--- /dev/null
+++ b/packages/Geographic/test/.eslintrc.cjs
@@ -0,0 +1,9 @@
+module.exports = {
+ rules: {
+ 'func-names': 'off',
+ 'prefer-arrow-callback': 'off',
+ },
+ env: {
+ mocha: true,
+ },
+};
diff --git a/test/unit/coordinate.js b/packages/Geographic/test/unit/coordinate.js
similarity index 99%
rename from test/unit/coordinate.js
rename to packages/Geographic/test/unit/coordinate.js
index 90b0524270..507d265183 100644
--- a/test/unit/coordinate.js
+++ b/packages/Geographic/test/unit/coordinate.js
@@ -1,7 +1,7 @@
import proj4 from 'proj4';
import { Vector3, Matrix4, Quaternion } from 'three';
import assert from 'assert';
-import Coordinates from 'Core/Geographic/Coordinates';
+import Coordinates from 'Coordinates';
// Define crs projection that we will use (taken from https://epsg.io/3946, Proj4js section)
proj4.defs('EPSG:3946', '+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
diff --git a/test/unit/crs.js b/packages/Geographic/test/unit/crs.js
similarity index 98%
rename from test/unit/crs.js
rename to packages/Geographic/test/unit/crs.js
index 4f9a1caff1..3c77932911 100644
--- a/test/unit/crs.js
+++ b/packages/Geographic/test/unit/crs.js
@@ -1,6 +1,6 @@
+import * as CRS from 'Crs';
import assert from 'assert';
import proj4 from 'proj4';
-import * as CRS from 'Core/Geographic/Crs';
proj4.defs('EPSG:7133', '+proj=longlat +ellps=GRS80 +no_defs +units=degrees');
proj4.defs('EPSG:INVALID', '+units=invalid +no_defs');
diff --git a/test/unit/ellipsoid.js b/packages/Geographic/test/unit/ellipsoid.js
similarity index 63%
rename from test/unit/ellipsoid.js
rename to packages/Geographic/test/unit/ellipsoid.js
index 877dbe3be3..a10f398c8f 100644
--- a/test/unit/ellipsoid.js
+++ b/packages/Geographic/test/unit/ellipsoid.js
@@ -1,6 +1,7 @@
+import { Ray, Vector3 } from 'three';
import assert from 'assert';
-import Coordinates from 'Core/Geographic/Coordinates';
-import Ellipsoid from 'Core/Math/Ellipsoid';
+import Coordinates from 'Coordinates';
+import Ellipsoid from 'Ellipsoid';
describe('Ellipsoid', function () {
const c1 = new Coordinates('EPSG:4326', 0, 0, 0);
@@ -50,4 +51,31 @@ describe('Ellipsoid', function () {
const d = ellipsoid.geodesicDistance(c3, c4) / 1000;
assert.ok(Math.abs(d - 200) < 0.01);
});
+
+ it('intersect ray with ellipsoid', () => {
+ const e = new Ellipsoid({ x: 1, y: 2, z: 3 });
+
+ // intersection to X axis
+ const ray = new Ray(new Vector3(10, 0, 0), new Vector3(-1, 0, 0));
+ const interX = e.intersection(ray);
+ assert.equal(interX.x, 1);
+ assert.equal(interX.y, 0);
+ assert.equal(interX.z, 0);
+
+ // intersection to Y axis
+ ray.origin.set(0, 10, 0);
+ ray.direction.set(0, -1, 0);
+ const interY = e.intersection(ray);
+ assert.equal(interY.x, 0);
+ assert.equal(interY.y, 2);
+ assert.equal(interY.z, 0);
+
+ // intersection to Z axis
+ ray.origin.set(0, 0, 10);
+ ray.direction.set(0, 0, -1);
+ const interZ = e.intersection(ray);
+ assert.equal(interZ.x, 0);
+ assert.equal(interZ.y, 0);
+ assert.equal(interZ.z.toFixed(5), 3);
+ });
});
diff --git a/test/unit/extent.js b/packages/Geographic/test/unit/extent.js
similarity index 99%
rename from test/unit/extent.js
rename to packages/Geographic/test/unit/extent.js
index 1557526f0e..084fc43c78 100644
--- a/test/unit/extent.js
+++ b/packages/Geographic/test/unit/extent.js
@@ -1,7 +1,7 @@
import assert from 'assert';
import { Box3, Vector3, Vector2, Matrix4, Quaternion } from 'three';
-import Coordinates from 'Core/Geographic/Coordinates';
-import Extent from 'Core/Geographic/Extent';
+import Coordinates from 'Coordinates';
+import Extent from 'Extent';
import proj4 from 'proj4';
proj4.defs('EPSG:2154', '+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
diff --git a/test/unit/orientationUtils.js b/packages/Geographic/test/unit/orientationUtils.js
similarity index 98%
rename from test/unit/orientationUtils.js
rename to packages/Geographic/test/unit/orientationUtils.js
index 9e8948d0c8..22dc075ff6 100644
--- a/test/unit/orientationUtils.js
+++ b/packages/Geographic/test/unit/orientationUtils.js
@@ -1,7 +1,7 @@
import * as THREE from 'three';
import assert from 'assert';
-import OrientationUtils from 'Utils/OrientationUtils';
-import Coordinates from 'Core/Geographic/Coordinates';
+import Coordinates from 'Coordinates';
+import OrientationUtils from 'OrientationUtils';
// Asster two float number are equals, with 5 digits precision.
function assertFloatEqual(float1, float2, msg, precision = 15) {
diff --git a/packages/Geographic/tsconfig.json b/packages/Geographic/tsconfig.json
new file mode 100644
index 0000000000..8c6936f80e
--- /dev/null
+++ b/packages/Geographic/tsconfig.json
@@ -0,0 +1,10 @@
+{
+ "extends": "../../tsconfig.json",
+ "include": [ "src/Main.js" ],
+ "exclude": [ "node_modules", "lib" ],
+ "compilerOptions": {
+ "paths": {
+ "*": [ "src/*" ]
+ },
+ }
+}
diff --git a/.babelrc b/packages/Main/.babelrc
similarity index 96%
rename from .babelrc
rename to packages/Main/.babelrc
index 02c1f168e9..90337692b3 100644
--- a/.babelrc
+++ b/packages/Main/.babelrc
@@ -10,6 +10,7 @@
],
"plugins": [
["module-resolver", {
+ "cwd": "packagejson",
"root": ["./src"],
"extensions": [".js", ".ts", ".tsx"]
}],
diff --git a/packages/Main/.eslintignore b/packages/Main/.eslintignore
new file mode 100644
index 0000000000..4abd04c588
--- /dev/null
+++ b/packages/Main/.eslintignore
@@ -0,0 +1,5 @@
+src/ThreeExtended/
+test/hooks.js
+dist/
+node_modules/
+test/data/
diff --git a/packages/Main/.eslintrc.cjs b/packages/Main/.eslintrc.cjs
new file mode 100644
index 0000000000..f15429438d
--- /dev/null
+++ b/packages/Main/.eslintrc.cjs
@@ -0,0 +1,6 @@
+
+module.exports = {
+ extends: [
+ '../../.eslintrc.cjs',
+ ],
+};
diff --git a/packages/Main/README.md b/packages/Main/README.md
new file mode 100644
index 0000000000..52bf3fa7ce
--- /dev/null
+++ b/packages/Main/README.md
@@ -0,0 +1,5 @@
+## What is it?
+
+This itowns module acts as a central point of access, allowing users to leverage the complete range of features offered by the @itowns submodules without needing to import or manage them individually.
+Refer to [README main](https://raw.githubusercontent.com/iTowns/itowns.github.io/master/README.md) for more information.
+The official documentation is [available here](http://www.itowns-project.org/itowns/docs/)
diff --git a/packages/Main/clean.cjs b/packages/Main/clean.cjs
new file mode 100644
index 0000000000..911900b21a
--- /dev/null
+++ b/packages/Main/clean.cjs
@@ -0,0 +1,5 @@
+const fs = require('node:fs');
+
+fs.rmSync('./examples', { recursive: true, force: true });
+fs.rmSync('./docs', { recursive: true, force: true });
+fs.rmSync('./dist', { recursive: true, force: true });
diff --git a/packages/Main/package.json b/packages/Main/package.json
new file mode 100644
index 0000000000..eb35d75358
--- /dev/null
+++ b/packages/Main/package.json
@@ -0,0 +1,73 @@
+{
+ "name": "itowns",
+ "version": "2.44.2",
+ "description": "A JS/WebGL framework for 3D geospatial data visualization",
+ "type": "module",
+ "main": "lib/Main.js",
+ "exports": {
+ ".": "./lib/Main.js",
+ "./widgets": "./lib/Utils/gui/Main.js"
+ },
+ "scripts": {
+ "lint": "eslint \"src/**/*.{js,ts,tsx}\" \"test/**/*.js\"",
+ "transpile": "cross-env BABEL_DISABLE_CACHE=1 babel src --out-dir lib --extensions .js,.ts",
+ "test-unit": "npm run base-test-unit test/unit",
+ "base-test-unit": "cross-env BABEL_DISABLE_CACHE=1 mocha --timeout 5000 --file test/unit/bootstrap.js --import=../../config/babel-register/register.mjs",
+ "test-with-coverage": "c8 -n src -r html cross-env npm run test-unit",
+ "test-with-coverage_lcov": "c8 -n src --reporter=lcov cross-env npm run test-unit",
+ "watch": "npm run transpile -- --watch",
+ "postinstall": "cross-env NO_UPDATE_NOTIFIER=true node ./scripts/prepare.mjs && node ./scripts/replace.config.mjs",
+ "prepublishOnly": "npx copyfiles -u 1 \"../../examples/**/*\" ./examples/ && npx copyfiles -u 1 \"../../docs/**/*\" ./docs/ && npx copyfiles -u 1 \"../../dist/**/*\" ./dist/ ",
+ "postpublish": "node clean.cjs",
+ "publish-next": "npm version prerelease --preid next && npm run update-package",
+ "update-package": "npm remove @itowns/geographic && npm install @itowns/geographic@$npm_package_version --save"
+ },
+ "c8": {
+ "exclude": [
+ "**/test/**",
+ "**/lib/**",
+ "**/*ThreeExtended",
+ "**/*src/Utils/placeObjectOnGround.js",
+ "**/*src/Parser/deprecated/LegacyGLTFLoader.js"
+ ]
+ },
+ "files": [
+ "*.md",
+ "dist",
+ "lib",
+ "doc",
+ "examples"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/iTowns/itowns.git"
+ },
+ "license": "(CECILL-B OR MIT)",
+ "bugs": {
+ "url": "https://github.com/iTowns/itowns/issues"
+ },
+ "dependencies": {
+ "@itowns/geographic": "^2.44.2",
+ "@mapbox/mapbox-gl-style-spec": "^13.28.0",
+ "@mapbox/vector-tile": "^2.0.3",
+ "@tmcw/togeojson": "^5.8.1",
+ "@tweenjs/tween.js": "^25.0.0",
+ "3d-tiles-renderer": "^0.3.39",
+ "brotli-compress": "^1.3.3",
+ "copc": "^0.0.6",
+ "earcut": "^3.0.0",
+ "js-priority-queue": "^0.1.5",
+ "pbf": "^4.0.1",
+ "shpjs": "^6.1.0",
+ "threads": "^1.7.0"
+ },
+ "peerDependencies": {
+ "proj4": "^2.12.1",
+ "three": "^0.168.0"
+ },
+ "devDependencies": {
+ "chalk": "^5.3.0",
+ "copyfiles": "^2.4.1"
+ },
+ "homepage": "https://itowns.github.io/"
+}
diff --git a/packages/Main/scripts/prepare.mjs b/packages/Main/scripts/prepare.mjs
new file mode 100644
index 0000000000..c7aa40b35f
--- /dev/null
+++ b/packages/Main/scripts/prepare.mjs
@@ -0,0 +1,16 @@
+import fs from 'node:fs';
+import copyfiles from 'copyfiles';
+import threeExamples from './threeExamples.mjs';
+
+let path = './node_modules/three/examples/jsm/';
+
+if (!fs.existsSync(path)) {
+ path = `../../${path}`;
+}
+
+// Copy THREE Examples Files
+const paths = threeExamples.filesExamples.map(f => f.replace('./', path));
+
+paths.push(threeExamples.patchedPath);
+
+copyfiles(paths, { up: 6 }, () => {});
diff --git a/config/replace.config.mjs b/packages/Main/scripts/replace.config.mjs
similarity index 100%
rename from config/replace.config.mjs
rename to packages/Main/scripts/replace.config.mjs
diff --git a/config/threeExamples.mjs b/packages/Main/scripts/threeExamples.mjs
similarity index 91%
rename from config/threeExamples.mjs
rename to packages/Main/scripts/threeExamples.mjs
index 9c1107d8a7..c3163860ca 100644
--- a/config/threeExamples.mjs
+++ b/packages/Main/scripts/threeExamples.mjs
@@ -9,6 +9,6 @@ export default {
'./utils/WorkerPool.js',
'./capabilities/WebGL.js',
'./libs/ktx-parse.module.js',
- './libs/zstddec.module.js'
+ './libs/zstddec.module.js',
],
};
diff --git a/src/Controls/FirstPersonControls.js b/packages/Main/src/Controls/FirstPersonControls.js
similarity index 100%
rename from src/Controls/FirstPersonControls.js
rename to packages/Main/src/Controls/FirstPersonControls.js
diff --git a/src/Controls/FlyControls.js b/packages/Main/src/Controls/FlyControls.js
similarity index 100%
rename from src/Controls/FlyControls.js
rename to packages/Main/src/Controls/FlyControls.js
diff --git a/src/Controls/GlobeControls.js b/packages/Main/src/Controls/GlobeControls.js
similarity index 99%
rename from src/Controls/GlobeControls.js
rename to packages/Main/src/Controls/GlobeControls.js
index 12f021b49f..1cd10032ae 100644
--- a/src/Controls/GlobeControls.js
+++ b/packages/Main/src/Controls/GlobeControls.js
@@ -1,7 +1,6 @@
import * as THREE from 'three';
import AnimationPlayer from 'Core/AnimationPlayer';
-import Coordinates from 'Core/Geographic/Coordinates';
-import { ellipsoidSizes } from 'Core/Math/Ellipsoid';
+import { Coordinates, ellipsoidSizes } from '@itowns/geographic';
import CameraUtils from 'Utils/CameraUtils';
import StateControl from 'Controls/StateControl';
import { VIEW_EVENTS } from 'Core/View';
diff --git a/src/Controls/PlanarControls.js b/packages/Main/src/Controls/PlanarControls.js
similarity index 100%
rename from src/Controls/PlanarControls.js
rename to packages/Main/src/Controls/PlanarControls.js
diff --git a/src/Controls/StateControl.js b/packages/Main/src/Controls/StateControl.js
similarity index 100%
rename from src/Controls/StateControl.js
rename to packages/Main/src/Controls/StateControl.js
diff --git a/src/Controls/StreetControls.js b/packages/Main/src/Controls/StreetControls.js
similarity index 100%
rename from src/Controls/StreetControls.js
rename to packages/Main/src/Controls/StreetControls.js
diff --git a/src/Converter/Feature2Mesh.js b/packages/Main/src/Converter/Feature2Mesh.js
similarity index 99%
rename from src/Converter/Feature2Mesh.js
rename to packages/Main/src/Converter/Feature2Mesh.js
index 85dca95ac1..9aeb0b75d0 100644
--- a/src/Converter/Feature2Mesh.js
+++ b/packages/Main/src/Converter/Feature2Mesh.js
@@ -3,9 +3,7 @@ import Earcut from 'earcut';
import { FEATURE_TYPES } from 'Core/Feature';
import ReferLayerProperties from 'Layer/ReferencingLayerProperties';
import { deprecatedFeature2MeshOptions } from 'Core/Deprecated/Undeprecator';
-import Extent from 'Core/Geographic/Extent';
-import OrientationUtils from 'Utils/OrientationUtils';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Extent, Coordinates, OrientationUtils } from '@itowns/geographic';
import Style, { StyleContext } from 'Core/Style';
const coord = new Coordinates('EPSG:4326', 0, 0, 0);
diff --git a/src/Converter/Feature2Texture.js b/packages/Main/src/Converter/Feature2Texture.js
similarity index 98%
rename from src/Converter/Feature2Texture.js
rename to packages/Main/src/Converter/Feature2Texture.js
index b197e7fe2b..1191018f7a 100644
--- a/src/Converter/Feature2Texture.js
+++ b/packages/Main/src/Converter/Feature2Texture.js
@@ -1,7 +1,6 @@
import * as THREE from 'three';
import { FEATURE_TYPES } from 'Core/Feature';
-import Extent from 'Core/Geographic/Extent';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Extent, Coordinates } from '@itowns/geographic';
import Style, { StyleContext } from 'Core/Style';
const defaultStyle = new Style();
diff --git a/src/Converter/convertToTile.js b/packages/Main/src/Converter/convertToTile.js
similarity index 100%
rename from src/Converter/convertToTile.js
rename to packages/Main/src/Converter/convertToTile.js
diff --git a/src/Converter/textureConverter.js b/packages/Main/src/Converter/textureConverter.js
similarity index 97%
rename from src/Converter/textureConverter.js
rename to packages/Main/src/Converter/textureConverter.js
index 5455e9d96f..9c49f39577 100644
--- a/src/Converter/textureConverter.js
+++ b/packages/Main/src/Converter/textureConverter.js
@@ -1,6 +1,6 @@
import * as THREE from 'three';
import Feature2Texture from 'Converter/Feature2Texture';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
const extentTexture = new Extent('EPSG:4326', [0, 0, 0, 0]);
diff --git a/src/Core/3DTiles/C3DTBatchTable.js b/packages/Main/src/Core/3DTiles/C3DTBatchTable.js
similarity index 100%
rename from src/Core/3DTiles/C3DTBatchTable.js
rename to packages/Main/src/Core/3DTiles/C3DTBatchTable.js
diff --git a/src/Core/3DTiles/C3DTBatchTableHierarchyExtension.js b/packages/Main/src/Core/3DTiles/C3DTBatchTableHierarchyExtension.js
similarity index 100%
rename from src/Core/3DTiles/C3DTBatchTableHierarchyExtension.js
rename to packages/Main/src/Core/3DTiles/C3DTBatchTableHierarchyExtension.js
diff --git a/src/Core/3DTiles/C3DTBoundingVolume.js b/packages/Main/src/Core/3DTiles/C3DTBoundingVolume.js
similarity index 98%
rename from src/Core/3DTiles/C3DTBoundingVolume.js
rename to packages/Main/src/Core/3DTiles/C3DTBoundingVolume.js
index d4ad136de8..59a98f1b32 100644
--- a/src/Core/3DTiles/C3DTBoundingVolume.js
+++ b/packages/Main/src/Core/3DTiles/C3DTBoundingVolume.js
@@ -1,6 +1,5 @@
import * as THREE from 'three';
-import Ellipsoid from 'Core/Math/Ellipsoid';
-import Coordinates from '../Geographic/Coordinates';
+import { Ellipsoid, Coordinates } from '@itowns/geographic';
import { C3DTilesTypes, C3DTilesBoundingVolumeTypes } from './C3DTilesEnums';
const ellipsoid = new Ellipsoid();
diff --git a/src/Core/3DTiles/C3DTExtensions.js b/packages/Main/src/Core/3DTiles/C3DTExtensions.js
similarity index 100%
rename from src/Core/3DTiles/C3DTExtensions.js
rename to packages/Main/src/Core/3DTiles/C3DTExtensions.js
diff --git a/src/Core/3DTiles/C3DTFeature.js b/packages/Main/src/Core/3DTiles/C3DTFeature.js
similarity index 100%
rename from src/Core/3DTiles/C3DTFeature.js
rename to packages/Main/src/Core/3DTiles/C3DTFeature.js
diff --git a/src/Core/3DTiles/C3DTilesEnums.js b/packages/Main/src/Core/3DTiles/C3DTilesEnums.js
similarity index 100%
rename from src/Core/3DTiles/C3DTilesEnums.js
rename to packages/Main/src/Core/3DTiles/C3DTilesEnums.js
diff --git a/src/Core/3DTiles/C3DTileset.js b/packages/Main/src/Core/3DTiles/C3DTileset.js
similarity index 100%
rename from src/Core/3DTiles/C3DTileset.js
rename to packages/Main/src/Core/3DTiles/C3DTileset.js
diff --git a/src/Core/3DTiles/utils/BinaryPropertyAccessor.js b/packages/Main/src/Core/3DTiles/utils/BinaryPropertyAccessor.js
similarity index 100%
rename from src/Core/3DTiles/utils/BinaryPropertyAccessor.js
rename to packages/Main/src/Core/3DTiles/utils/BinaryPropertyAccessor.js
diff --git a/src/Core/AnimationPlayer.js b/packages/Main/src/Core/AnimationPlayer.js
similarity index 100%
rename from src/Core/AnimationPlayer.js
rename to packages/Main/src/Core/AnimationPlayer.js
diff --git a/src/Core/CopcNode.js b/packages/Main/src/Core/CopcNode.js
similarity index 100%
rename from src/Core/CopcNode.js
rename to packages/Main/src/Core/CopcNode.js
diff --git a/src/Core/Deprecated/Undeprecator.js b/packages/Main/src/Core/Deprecated/Undeprecator.js
similarity index 100%
rename from src/Core/Deprecated/Undeprecator.js
rename to packages/Main/src/Core/Deprecated/Undeprecator.js
diff --git a/src/Core/EntwinePointTileNode.js b/packages/Main/src/Core/EntwinePointTileNode.js
similarity index 100%
rename from src/Core/EntwinePointTileNode.js
rename to packages/Main/src/Core/EntwinePointTileNode.js
diff --git a/src/Core/Feature.js b/packages/Main/src/Core/Feature.js
similarity index 99%
rename from src/Core/Feature.js
rename to packages/Main/src/Core/Feature.js
index 018bb45c95..8c0e4bf310 100644
--- a/src/Core/Feature.js
+++ b/packages/Main/src/Core/Feature.js
@@ -1,6 +1,5 @@
import * as THREE from 'three';
-import Extent from 'Core/Geographic/Extent';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Extent, Coordinates } from '@itowns/geographic';
import Style from 'Core/Style';
function defaultExtent(crs) {
diff --git a/src/Core/Geographic/GeoidGrid.js b/packages/Main/src/Core/Geographic/GeoidGrid.js
similarity index 98%
rename from src/Core/Geographic/GeoidGrid.js
rename to packages/Main/src/Core/Geographic/GeoidGrid.js
index 1d5d3cbfa7..a8621bba70 100644
--- a/src/Core/Geographic/GeoidGrid.js
+++ b/packages/Main/src/Core/Geographic/GeoidGrid.js
@@ -1,7 +1,5 @@
import * as THREE from 'three';
-import * as CRS from 'Core/Geographic/Crs';
-import Coordinates from 'Core/Geographic/Coordinates';
-
+import { Coordinates, CRS } from '@itowns/geographic';
const coord = new Coordinates('EPSG:4326');
const indexes = new THREE.Vector2();
diff --git a/src/Core/Label.js b/packages/Main/src/Core/Label.js
similarity index 99%
rename from src/Core/Label.js
rename to packages/Main/src/Core/Label.js
index 019185443f..41fb696064 100644
--- a/src/Core/Label.js
+++ b/packages/Main/src/Core/Label.js
@@ -1,6 +1,6 @@
import * as THREE from 'three';
import DEMUtils from 'Utils/DEMUtils';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
const coord = new Coordinates('EPSG:4326');
let rect;
diff --git a/src/Core/MainLoop.js b/packages/Main/src/Core/MainLoop.js
similarity index 100%
rename from src/Core/MainLoop.js
rename to packages/Main/src/Core/MainLoop.js
diff --git a/src/Core/Picking.js b/packages/Main/src/Core/Picking.js
similarity index 99%
rename from src/Core/Picking.js
rename to packages/Main/src/Core/Picking.js
index 117d31098f..8769046545 100644
--- a/src/Core/Picking.js
+++ b/packages/Main/src/Core/Picking.js
@@ -1,7 +1,7 @@
import * as THREE from 'three';
import RenderMode from 'Renderer/RenderMode';
import { unpack1K } from 'Renderer/LayeredMaterial';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
const depthRGBA = new THREE.Vector4();
// TileMesh picking support function
diff --git a/src/Core/PointCloudNode.js b/packages/Main/src/Core/PointCloudNode.js
similarity index 100%
rename from src/Core/PointCloudNode.js
rename to packages/Main/src/Core/PointCloudNode.js
diff --git a/src/Core/Potree2Node.js b/packages/Main/src/Core/Potree2Node.js
similarity index 100%
rename from src/Core/Potree2Node.js
rename to packages/Main/src/Core/Potree2Node.js
diff --git a/src/Core/Potree2PointAttributes.js b/packages/Main/src/Core/Potree2PointAttributes.js
similarity index 100%
rename from src/Core/Potree2PointAttributes.js
rename to packages/Main/src/Core/Potree2PointAttributes.js
diff --git a/src/Core/PotreeNode.js b/packages/Main/src/Core/PotreeNode.js
similarity index 100%
rename from src/Core/PotreeNode.js
rename to packages/Main/src/Core/PotreeNode.js
diff --git a/src/Core/Prefab/Globe/Atmosphere.js b/packages/Main/src/Core/Prefab/Globe/Atmosphere.js
similarity index 98%
rename from src/Core/Prefab/Globe/Atmosphere.js
rename to packages/Main/src/Core/Prefab/Globe/Atmosphere.js
index f5df486ec1..e28d04d196 100644
--- a/src/Core/Prefab/Globe/Atmosphere.js
+++ b/packages/Main/src/Core/Prefab/Globe/Atmosphere.js
@@ -7,9 +7,7 @@
import * as THREE from 'three';
import GeometryLayer from 'Layer/GeometryLayer';
-import Coordinates from 'Core/Geographic/Coordinates';
-import { ellipsoidSizes } from 'Core/Math/Ellipsoid';
-import CoordStars from 'Core/Geographic/CoordStars';
+import { Coordinates, ellipsoidSizes, CoordStars } from '@itowns/geographic';
import Sky from './SkyShader';
import skyFS from './Shaders/skyFS.glsl';
import skyVS from './Shaders/skyVS.glsl';
diff --git a/src/Core/Prefab/Globe/GlobeLayer.js b/packages/Main/src/Core/Prefab/Globe/GlobeLayer.js
similarity index 99%
rename from src/Core/Prefab/Globe/GlobeLayer.js
rename to packages/Main/src/Core/Prefab/Globe/GlobeLayer.js
index 3aa9f5a03f..54f2530c47 100644
--- a/src/Core/Prefab/Globe/GlobeLayer.js
+++ b/packages/Main/src/Core/Prefab/Globe/GlobeLayer.js
@@ -1,6 +1,6 @@
import * as THREE from 'three';
import TiledGeometryLayer from 'Layer/TiledGeometryLayer';
-import { ellipsoidSizes } from 'Core/Math/Ellipsoid';
+import { ellipsoidSizes } from '@itowns/geographic';
import { globalExtentTMS, schemeTiles } from 'Core/Tile/TileGrid';
import { GlobeTileBuilder } from 'Core/Prefab/Globe/GlobeTileBuilder';
diff --git a/src/Core/Prefab/Globe/GlobeTileBuilder.ts b/packages/Main/src/Core/Prefab/Globe/GlobeTileBuilder.ts
similarity index 98%
rename from src/Core/Prefab/Globe/GlobeTileBuilder.ts
rename to packages/Main/src/Core/Prefab/Globe/GlobeTileBuilder.ts
index 39bc384ae2..0ea311e678 100644
--- a/src/Core/Prefab/Globe/GlobeTileBuilder.ts
+++ b/packages/Main/src/Core/Prefab/Globe/GlobeTileBuilder.ts
@@ -1,6 +1,5 @@
import * as THREE from 'three';
-import Coordinates from 'Core/Geographic/Coordinates';
-import Extent from 'Core/Geographic/Extent';
+import { Coordinates, Extent } from '@itowns/geographic';
import {
ShareableExtent,
TileBuilder,
diff --git a/src/Core/Prefab/Globe/Shaders/CloudsFS.glsl b/packages/Main/src/Core/Prefab/Globe/Shaders/CloudsFS.glsl
similarity index 100%
rename from src/Core/Prefab/Globe/Shaders/CloudsFS.glsl
rename to packages/Main/src/Core/Prefab/Globe/Shaders/CloudsFS.glsl
diff --git a/src/Core/Prefab/Globe/Shaders/CloudsVS.glsl b/packages/Main/src/Core/Prefab/Globe/Shaders/CloudsVS.glsl
similarity index 100%
rename from src/Core/Prefab/Globe/Shaders/CloudsVS.glsl
rename to packages/Main/src/Core/Prefab/Globe/Shaders/CloudsVS.glsl
diff --git a/src/Core/Prefab/Globe/Shaders/GlowFS.glsl b/packages/Main/src/Core/Prefab/Globe/Shaders/GlowFS.glsl
similarity index 100%
rename from src/Core/Prefab/Globe/Shaders/GlowFS.glsl
rename to packages/Main/src/Core/Prefab/Globe/Shaders/GlowFS.glsl
diff --git a/src/Core/Prefab/Globe/Shaders/GlowVS.glsl b/packages/Main/src/Core/Prefab/Globe/Shaders/GlowVS.glsl
similarity index 100%
rename from src/Core/Prefab/Globe/Shaders/GlowVS.glsl
rename to packages/Main/src/Core/Prefab/Globe/Shaders/GlowVS.glsl
diff --git a/src/Core/Prefab/Globe/Shaders/groundFS.glsl b/packages/Main/src/Core/Prefab/Globe/Shaders/groundFS.glsl
similarity index 100%
rename from src/Core/Prefab/Globe/Shaders/groundFS.glsl
rename to packages/Main/src/Core/Prefab/Globe/Shaders/groundFS.glsl
diff --git a/src/Core/Prefab/Globe/Shaders/groundVS.glsl b/packages/Main/src/Core/Prefab/Globe/Shaders/groundVS.glsl
similarity index 100%
rename from src/Core/Prefab/Globe/Shaders/groundVS.glsl
rename to packages/Main/src/Core/Prefab/Globe/Shaders/groundVS.glsl
diff --git a/src/Core/Prefab/Globe/Shaders/skyFS.glsl b/packages/Main/src/Core/Prefab/Globe/Shaders/skyFS.glsl
similarity index 100%
rename from src/Core/Prefab/Globe/Shaders/skyFS.glsl
rename to packages/Main/src/Core/Prefab/Globe/Shaders/skyFS.glsl
diff --git a/src/Core/Prefab/Globe/Shaders/skyVS.glsl b/packages/Main/src/Core/Prefab/Globe/Shaders/skyVS.glsl
similarity index 100%
rename from src/Core/Prefab/Globe/Shaders/skyVS.glsl
rename to packages/Main/src/Core/Prefab/Globe/Shaders/skyVS.glsl
diff --git a/src/Core/Prefab/Globe/SkyShader.js b/packages/Main/src/Core/Prefab/Globe/SkyShader.js
similarity index 100%
rename from src/Core/Prefab/Globe/SkyShader.js
rename to packages/Main/src/Core/Prefab/Globe/SkyShader.js
diff --git a/src/Core/Prefab/GlobeView.js b/packages/Main/src/Core/Prefab/GlobeView.js
similarity index 98%
rename from src/Core/Prefab/GlobeView.js
rename to packages/Main/src/Core/Prefab/GlobeView.js
index ce90a53661..7ed69e0787 100644
--- a/src/Core/Prefab/GlobeView.js
+++ b/packages/Main/src/Core/Prefab/GlobeView.js
@@ -2,14 +2,11 @@ import * as THREE from 'three';
import View, { VIEW_EVENTS } from 'Core/View';
import GlobeControls from 'Controls/GlobeControls';
-import Coordinates from 'Core/Geographic/Coordinates';
-
+import { Coordinates, ellipsoidSizes } from '@itowns/geographic';
import GlobeLayer from 'Core/Prefab/Globe/GlobeLayer';
import Atmosphere from 'Core/Prefab/Globe/Atmosphere';
import CameraUtils from 'Utils/CameraUtils';
-import { ellipsoidSizes } from 'Core/Math/Ellipsoid';
-
/**
* Fires when the view is completely loaded. Controls and view's functions can be called then.
* @event GlobeView#initialized
diff --git a/src/Core/Prefab/Planar/PlanarLayer.js b/packages/Main/src/Core/Prefab/Planar/PlanarLayer.js
similarity index 100%
rename from src/Core/Prefab/Planar/PlanarLayer.js
rename to packages/Main/src/Core/Prefab/Planar/PlanarLayer.js
diff --git a/src/Core/Prefab/Planar/PlanarTileBuilder.ts b/packages/Main/src/Core/Prefab/Planar/PlanarTileBuilder.ts
similarity index 96%
rename from src/Core/Prefab/Planar/PlanarTileBuilder.ts
rename to packages/Main/src/Core/Prefab/Planar/PlanarTileBuilder.ts
index 30a18e7650..56f77875b2 100644
--- a/src/Core/Prefab/Planar/PlanarTileBuilder.ts
+++ b/packages/Main/src/Core/Prefab/Planar/PlanarTileBuilder.ts
@@ -1,6 +1,5 @@
import * as THREE from 'three';
-import Coordinates from 'Core/Geographic/Coordinates';
-import Extent from 'Core/Geographic/Extent';
+import { Coordinates, Extent } from '@itowns/geographic';
import {
ShareableExtent,
TileBuilder,
diff --git a/src/Core/Prefab/PlanarView.js b/packages/Main/src/Core/Prefab/PlanarView.js
similarity index 100%
rename from src/Core/Prefab/PlanarView.js
rename to packages/Main/src/Core/Prefab/PlanarView.js
diff --git a/src/Core/Prefab/TileBuilder.ts b/packages/Main/src/Core/Prefab/TileBuilder.ts
similarity index 98%
rename from src/Core/Prefab/TileBuilder.ts
rename to packages/Main/src/Core/Prefab/TileBuilder.ts
index 35e1a2d97f..002de6fdf3 100644
--- a/src/Core/Prefab/TileBuilder.ts
+++ b/packages/Main/src/Core/Prefab/TileBuilder.ts
@@ -3,8 +3,8 @@ import { TileGeometry } from 'Core/TileGeometry';
import Cache from 'Core/Scheduler/Cache';
import { computeBuffers } from 'Core/Prefab/computeBufferTileGeometry';
import OBB from 'Renderer/OBB';
-import type Extent from 'Core/Geographic/Extent';
-import Coordinates from 'Core/Geographic/Coordinates';
+import type { Extent } from '@itowns/geographic';
+import { Coordinates } from '@itowns/geographic';
const cacheBuffer = new Map();
const cacheTile = new Cache();
diff --git a/src/Core/Prefab/computeBufferTileGeometry.ts b/packages/Main/src/Core/Prefab/computeBufferTileGeometry.ts
similarity index 100%
rename from src/Core/Prefab/computeBufferTileGeometry.ts
rename to packages/Main/src/Core/Prefab/computeBufferTileGeometry.ts
diff --git a/src/Core/Scheduler/Cache.js b/packages/Main/src/Core/Scheduler/Cache.js
similarity index 100%
rename from src/Core/Scheduler/Cache.js
rename to packages/Main/src/Core/Scheduler/Cache.js
diff --git a/src/Core/Scheduler/CancelledCommandException.js b/packages/Main/src/Core/Scheduler/CancelledCommandException.js
similarity index 100%
rename from src/Core/Scheduler/CancelledCommandException.js
rename to packages/Main/src/Core/Scheduler/CancelledCommandException.js
diff --git a/src/Core/Scheduler/Scheduler.js b/packages/Main/src/Core/Scheduler/Scheduler.js
similarity index 100%
rename from src/Core/Scheduler/Scheduler.js
rename to packages/Main/src/Core/Scheduler/Scheduler.js
diff --git a/src/Core/Style.js b/packages/Main/src/Core/Style.js
similarity index 99%
rename from src/Core/Style.js
rename to packages/Main/src/Core/Style.js
index 3e716bd26a..2f26b88694 100644
--- a/src/Core/Style.js
+++ b/packages/Main/src/Core/Style.js
@@ -1,10 +1,10 @@
+import { Coordinates } from '@itowns/geographic';
import { FEATURE_TYPES } from 'Core/Feature';
import Cache from 'Core/Scheduler/Cache';
import Fetcher from 'Provider/Fetcher';
import * as mapbox from '@mapbox/mapbox-gl-style-spec';
import { Color } from 'three';
import { deltaE } from 'Renderer/Color';
-import Coordinates from 'Core/Geographic/Coordinates';
import itowns_stroke_single_before from './StyleChunk/itowns_stroke_single_before.css';
diff --git a/src/Core/StyleChunk/itowns_stroke_single_before.css b/packages/Main/src/Core/StyleChunk/itowns_stroke_single_before.css
similarity index 100%
rename from src/Core/StyleChunk/itowns_stroke_single_before.css
rename to packages/Main/src/Core/StyleChunk/itowns_stroke_single_before.css
diff --git a/src/Core/System/Capabilities.js b/packages/Main/src/Core/System/Capabilities.js
similarity index 95%
rename from src/Core/System/Capabilities.js
rename to packages/Main/src/Core/System/Capabilities.js
index 94d468608e..6a7bc004e0 100644
--- a/src/Core/System/Capabilities.js
+++ b/packages/Main/src/Core/System/Capabilities.js
@@ -1,5 +1,5 @@
-import SampleTestFS from 'Renderer/Shader/SampleTestFS.glsl';
-import SampleTestVS from 'Renderer/Shader/SampleTestVS.glsl';
+import SampleTestFS from '../../Renderer/Shader/SampleTestFS.glsl';
+import SampleTestVS from '../../Renderer/Shader/SampleTestVS.glsl';
// default values
let logDepthBufferSupported = false;
diff --git a/src/Core/Tile/Tile.js b/packages/Main/src/Core/Tile/Tile.js
similarity index 98%
rename from src/Core/Tile/Tile.js
rename to packages/Main/src/Core/Tile/Tile.js
index d0912b7c90..8ea6e0d1c5 100644
--- a/src/Core/Tile/Tile.js
+++ b/packages/Main/src/Core/Tile/Tile.js
@@ -1,7 +1,5 @@
import * as THREE from 'three';
-import * as CRS from '../Geographic/Crs';
-import Coordinates from '../Geographic/Coordinates';
-import Extent from '../Geographic/Extent';
+import { Coordinates, CRS, Extent } from '@itowns/geographic';
import { getInfoTms, getCountTiles } from './TileGrid';
const _tmsCoord = new THREE.Vector2();
diff --git a/src/Core/Tile/TileGrid.js b/packages/Main/src/Core/Tile/TileGrid.js
similarity index 97%
rename from src/Core/Tile/TileGrid.js
rename to packages/Main/src/Core/Tile/TileGrid.js
index a6eb619b35..f7f2fbb409 100644
--- a/src/Core/Tile/TileGrid.js
+++ b/packages/Main/src/Core/Tile/TileGrid.js
@@ -1,5 +1,5 @@
import * as THREE from 'three';
-import Extent from '../Geographic/Extent';
+import { Extent } from '@itowns/geographic';
const _countTiles = new THREE.Vector2();
const _dim = new THREE.Vector2();
diff --git a/src/Core/TileGeometry.ts b/packages/Main/src/Core/TileGeometry.ts
similarity index 98%
rename from src/Core/TileGeometry.ts
rename to packages/Main/src/Core/TileGeometry.ts
index e63f5a1ac7..8112819d55 100644
--- a/src/Core/TileGeometry.ts
+++ b/packages/Main/src/Core/TileGeometry.ts
@@ -4,11 +4,11 @@ import { computeBuffers, getBufferIndexSize }
from 'Core/Prefab/computeBufferTileGeometry';
import { GpuBufferAttributes, TileBuilder, TileBuilderParams }
from 'Core/Prefab/TileBuilder';
-import Extent from 'Core/Geographic/Extent';
+import { Coordinates, Extent } from '@itowns/geographic';
+
import Cache from 'Core/Scheduler/Cache';
import OBB from 'Renderer/OBB';
-import Coordinates from './Geographic/Coordinates';
type PartialTileBuilderParams =
Pick
diff --git a/src/Core/TileMesh.js b/packages/Main/src/Core/TileMesh.js
similarity index 100%
rename from src/Core/TileMesh.js
rename to packages/Main/src/Core/TileMesh.js
diff --git a/src/Core/View.js b/packages/Main/src/Core/View.js
similarity index 99%
rename from src/Core/View.js
rename to packages/Main/src/Core/View.js
index 72dff1f4ea..ab459331bf 100644
--- a/src/Core/View.js
+++ b/packages/Main/src/Core/View.js
@@ -1,5 +1,5 @@
import * as THREE from 'three';
-import * as CRS from 'Core/Geographic/Crs';
+import { CRS, Coordinates } from '@itowns/geographic';
import Camera from 'Renderer/Camera';
import initializeWebXR from 'Renderer/WebXR';
import MainLoop, { MAIN_LOOP_EVENTS, RENDERING_PAUSED } from 'Core/MainLoop';
@@ -7,7 +7,6 @@ import Capabilities from 'Core/System/Capabilities';
import { COLOR_LAYERS_ORDER_CHANGED } from 'Renderer/ColorLayersOrdering';
import c3DEngine from 'Renderer/c3DEngine';
import RenderMode from 'Renderer/RenderMode';
-import Coordinates from 'Core/Geographic/Coordinates';
import FeaturesUtils from 'Utils/FeaturesUtils';
import { getMaxColorSamplerUnitsCount } from 'Renderer/LayeredMaterial';
import Scheduler from 'Core/Scheduler/Scheduler';
diff --git a/src/Layer/C3DTilesLayer.js b/packages/Main/src/Layer/C3DTilesLayer.js
similarity index 100%
rename from src/Layer/C3DTilesLayer.js
rename to packages/Main/src/Layer/C3DTilesLayer.js
diff --git a/src/Layer/ColorLayer.js b/packages/Main/src/Layer/ColorLayer.js
similarity index 100%
rename from src/Layer/ColorLayer.js
rename to packages/Main/src/Layer/ColorLayer.js
diff --git a/src/Layer/CopcLayer.js b/packages/Main/src/Layer/CopcLayer.js
similarity index 100%
rename from src/Layer/CopcLayer.js
rename to packages/Main/src/Layer/CopcLayer.js
diff --git a/src/Layer/ElevationLayer.js b/packages/Main/src/Layer/ElevationLayer.js
similarity index 100%
rename from src/Layer/ElevationLayer.js
rename to packages/Main/src/Layer/ElevationLayer.js
diff --git a/src/Layer/EntwinePointTileLayer.js b/packages/Main/src/Layer/EntwinePointTileLayer.js
similarity index 98%
rename from src/Layer/EntwinePointTileLayer.js
rename to packages/Main/src/Layer/EntwinePointTileLayer.js
index 0a1add49a4..7fdf013037 100644
--- a/src/Layer/EntwinePointTileLayer.js
+++ b/packages/Main/src/Layer/EntwinePointTileLayer.js
@@ -1,7 +1,7 @@
import * as THREE from 'three';
import EntwinePointTileNode from 'Core/EntwinePointTileNode';
import PointCloudLayer from 'Layer/PointCloudLayer';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
const bboxMesh = new THREE.Mesh();
const box3 = new THREE.Box3();
diff --git a/src/Layer/FeatureGeometryLayer.js b/packages/Main/src/Layer/FeatureGeometryLayer.js
similarity index 100%
rename from src/Layer/FeatureGeometryLayer.js
rename to packages/Main/src/Layer/FeatureGeometryLayer.js
diff --git a/src/Layer/GeoidLayer.js b/packages/Main/src/Layer/GeoidLayer.js
similarity index 100%
rename from src/Layer/GeoidLayer.js
rename to packages/Main/src/Layer/GeoidLayer.js
diff --git a/src/Layer/GeometryLayer.js b/packages/Main/src/Layer/GeometryLayer.js
similarity index 100%
rename from src/Layer/GeometryLayer.js
rename to packages/Main/src/Layer/GeometryLayer.js
diff --git a/src/Layer/InfoLayer.js b/packages/Main/src/Layer/InfoLayer.js
similarity index 98%
rename from src/Layer/InfoLayer.js
rename to packages/Main/src/Layer/InfoLayer.js
index d82677e744..a36bcbaf8d 100644
--- a/src/Layer/InfoLayer.js
+++ b/packages/Main/src/Layer/InfoLayer.js
@@ -1,4 +1,4 @@
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
export default class InfoLayer {
constructor(layer) {
diff --git a/src/Layer/LabelLayer.js b/packages/Main/src/Layer/LabelLayer.js
similarity index 99%
rename from src/Layer/LabelLayer.js
rename to packages/Main/src/Layer/LabelLayer.js
index 1dcd649b00..dbddc73ddb 100644
--- a/src/Layer/LabelLayer.js
+++ b/packages/Main/src/Layer/LabelLayer.js
@@ -2,8 +2,7 @@ import * as THREE from 'three';
import LayerUpdateState from 'Layer/LayerUpdateState';
import ObjectRemovalHelper from 'Process/ObjectRemovalHelper';
import GeometryLayer from 'Layer/GeometryLayer';
-import Coordinates from 'Core/Geographic/Coordinates';
-import Extent from 'Core/Geographic/Extent';
+import { Coordinates, Extent } from '@itowns/geographic';
import Label from 'Core/Label';
import { FEATURE_TYPES } from 'Core/Feature';
import { readExpression, StyleContext } from 'Core/Style';
diff --git a/src/Layer/Layer.js b/packages/Main/src/Layer/Layer.js
similarity index 100%
rename from src/Layer/Layer.js
rename to packages/Main/src/Layer/Layer.js
diff --git a/src/Layer/LayerUpdateState.js b/packages/Main/src/Layer/LayerUpdateState.js
similarity index 100%
rename from src/Layer/LayerUpdateState.js
rename to packages/Main/src/Layer/LayerUpdateState.js
diff --git a/src/Layer/LayerUpdateStrategy.js b/packages/Main/src/Layer/LayerUpdateStrategy.js
similarity index 100%
rename from src/Layer/LayerUpdateStrategy.js
rename to packages/Main/src/Layer/LayerUpdateStrategy.js
diff --git a/src/Layer/OGC3DTilesLayer.js b/packages/Main/src/Layer/OGC3DTilesLayer.js
similarity index 100%
rename from src/Layer/OGC3DTilesLayer.js
rename to packages/Main/src/Layer/OGC3DTilesLayer.js
diff --git a/src/Layer/OrientedImageLayer.js b/packages/Main/src/Layer/OrientedImageLayer.js
similarity index 98%
rename from src/Layer/OrientedImageLayer.js
rename to packages/Main/src/Layer/OrientedImageLayer.js
index 39a5229e49..c8bc1739cd 100644
--- a/src/Layer/OrientedImageLayer.js
+++ b/packages/Main/src/Layer/OrientedImageLayer.js
@@ -3,8 +3,7 @@ import GeometryLayer from 'Layer/GeometryLayer';
import OrientedImageMaterial from 'Renderer/OrientedImageMaterial';
import GeoJsonParser from 'Parser/GeoJsonParser';
import CameraCalibrationParser from 'Parser/CameraCalibrationParser';
-import Coordinates from 'Core/Geographic/Coordinates';
-import OrientationUtils from 'Utils/OrientationUtils';
+import { Coordinates, OrientationUtils } from '@itowns/geographic';
const coord = new Coordinates('EPSG:4978', 0, 0, 0);
const commandCancellation = cmd => cmd.requester.id !== cmd.layer.currentPano.id;
diff --git a/src/Layer/PointCloudLayer.js b/packages/Main/src/Layer/PointCloudLayer.js
similarity index 100%
rename from src/Layer/PointCloudLayer.js
rename to packages/Main/src/Layer/PointCloudLayer.js
diff --git a/src/Layer/Potree2Layer.js b/packages/Main/src/Layer/Potree2Layer.js
similarity index 99%
rename from src/Layer/Potree2Layer.js
rename to packages/Main/src/Layer/Potree2Layer.js
index df8e7501d0..9d6302156b 100644
--- a/src/Layer/Potree2Layer.js
+++ b/packages/Main/src/Layer/Potree2Layer.js
@@ -36,7 +36,7 @@ of the authors and should not be interpreted as representing official policies,
import * as THREE from 'three';
import PointCloudLayer from 'Layer/PointCloudLayer';
import Potree2Node from 'Core/Potree2Node';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
import { PointAttribute, Potree2PointAttributes, PointAttributeTypes } from 'Core/Potree2PointAttributes';
diff --git a/src/Layer/PotreeLayer.js b/packages/Main/src/Layer/PotreeLayer.js
similarity index 98%
rename from src/Layer/PotreeLayer.js
rename to packages/Main/src/Layer/PotreeLayer.js
index 2940272602..de00920673 100644
--- a/src/Layer/PotreeLayer.js
+++ b/packages/Main/src/Layer/PotreeLayer.js
@@ -1,7 +1,7 @@
import * as THREE from 'three';
import PointCloudLayer from 'Layer/PointCloudLayer';
import PotreeNode from 'Core/PotreeNode';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
const bboxMesh = new THREE.Mesh();
const box3 = new THREE.Box3();
diff --git a/src/Layer/RasterLayer.js b/packages/Main/src/Layer/RasterLayer.js
similarity index 100%
rename from src/Layer/RasterLayer.js
rename to packages/Main/src/Layer/RasterLayer.js
diff --git a/src/Layer/ReferencingLayerProperties.js b/packages/Main/src/Layer/ReferencingLayerProperties.js
similarity index 100%
rename from src/Layer/ReferencingLayerProperties.js
rename to packages/Main/src/Layer/ReferencingLayerProperties.js
diff --git a/src/Layer/TiledGeometryLayer.js b/packages/Main/src/Layer/TiledGeometryLayer.js
similarity index 100%
rename from src/Layer/TiledGeometryLayer.js
rename to packages/Main/src/Layer/TiledGeometryLayer.js
diff --git a/src/Loader/LASLoader.js b/packages/Main/src/Loader/LASLoader.js
similarity index 100%
rename from src/Loader/LASLoader.js
rename to packages/Main/src/Loader/LASLoader.js
diff --git a/src/Loader/Potree2BrotliLoader.js b/packages/Main/src/Loader/Potree2BrotliLoader.js
similarity index 100%
rename from src/Loader/Potree2BrotliLoader.js
rename to packages/Main/src/Loader/Potree2BrotliLoader.js
diff --git a/src/Loader/Potree2Loader.js b/packages/Main/src/Loader/Potree2Loader.js
similarity index 100%
rename from src/Loader/Potree2Loader.js
rename to packages/Main/src/Loader/Potree2Loader.js
diff --git a/src/Main.js b/packages/Main/src/Main.js
similarity index 95%
rename from src/Main.js
rename to packages/Main/src/Main.js
index 3b5d49c448..1829f00b3c 100644
--- a/src/Main.js
+++ b/packages/Main/src/Main.js
@@ -1,15 +1,13 @@
const conf = {
version: '2.44.2',
};
+
export const REVISION = conf.version;
// Geographic tools
-export { default as Extent } from 'Core/Geographic/Extent';
-export { default as Coordinates } from 'Core/Geographic/Coordinates';
+export { Coordinates, Extent, CRS, Ellipsoid, ellipsoidSizes, OrientationUtils } from '@itowns/geographic';
export { default as GeoidGrid } from 'Core/Geographic/GeoidGrid';
-export * as CRS from 'Core/Geographic/Crs';
-export { default as Ellipsoid, ellipsoidSizes } from 'Core/Math/Ellipsoid';
export { default as GlobeView, GLOBE_VIEW_EVENTS } from 'Core/Prefab/GlobeView';
export { default as PlanarView } from 'Core/Prefab/PlanarView';
export { default as Fetcher } from 'Provider/Fetcher';
@@ -17,6 +15,7 @@ export { MAIN_LOOP_EVENTS } from 'Core/MainLoop';
export { default as View } from 'Core/View';
export { VIEW_EVENTS } from 'Core/View';
export { default as FeatureProcessing } from 'Process/FeatureProcessing';
+export { default as ObjectRemovalHelper } from 'Process/ObjectRemovalHelper';
export { updateLayeredMaterialNodeImagery, updateLayeredMaterialNodeElevation } from 'Process/LayeredMaterialNodeProcessing';
export { default as OrientedImageCamera } from 'Renderer/OrientedImageCamera';
export { default as PointsMaterial, PNTS_MODE, PNTS_SHAPE, PNTS_SIZE_MODE, ClassificationScheme } from 'Renderer/PointsMaterial';
@@ -31,11 +30,11 @@ export { default as Feature2Mesh } from 'Converter/Feature2Mesh';
export { default as FeaturesUtils } from 'Utils/FeaturesUtils';
export { default as DEMUtils } from 'Utils/DEMUtils';
export { default as CameraUtils } from 'Utils/CameraUtils';
-export { default as OrientationUtils } from 'Utils/OrientationUtils';
export { default as ShaderChunk } from 'Renderer/Shader/ShaderChunk';
export { getMaxColorSamplerUnitsCount, colorLayerEffects } from 'Renderer/LayeredMaterial';
export { default as Capabilities } from 'Core/System/Capabilities';
export { CAMERA_TYPE } from 'Renderer/Camera';
+export { default as OBB } from 'Renderer/OBB';
// Internal itowns format
export { default as Feature, FeatureCollection, FeatureGeometry, FEATURE_TYPES } from 'Core/Feature';
diff --git a/src/MainBundle.js b/packages/Main/src/MainBundle.js
similarity index 79%
rename from src/MainBundle.js
rename to packages/Main/src/MainBundle.js
index e81f70997a..da0369673a 100644
--- a/src/MainBundle.js
+++ b/packages/Main/src/MainBundle.js
@@ -3,5 +3,5 @@ import * as THREE from 'three';
export { THREE };
export { default as proj4 } from 'proj4';
-export * from 'Main.js';
+export * from './Main';
diff --git a/src/Parser/B3dmParser.js b/packages/Main/src/Parser/B3dmParser.js
similarity index 100%
rename from src/Parser/B3dmParser.js
rename to packages/Main/src/Parser/B3dmParser.js
diff --git a/src/Parser/CameraCalibrationParser.js b/packages/Main/src/Parser/CameraCalibrationParser.js
similarity index 100%
rename from src/Parser/CameraCalibrationParser.js
rename to packages/Main/src/Parser/CameraCalibrationParser.js
diff --git a/src/Parser/GDFParser.js b/packages/Main/src/Parser/GDFParser.js
similarity index 98%
rename from src/Parser/GDFParser.js
rename to packages/Main/src/Parser/GDFParser.js
index 42214ce316..22fbacebb6 100644
--- a/src/Parser/GDFParser.js
+++ b/packages/Main/src/Parser/GDFParser.js
@@ -1,6 +1,6 @@
import * as THREE from 'three';
+import { Extent } from '@itowns/geographic';
import GeoidGrid from 'Core/Geographic/GeoidGrid';
-import Extent from 'Core/Geographic/Extent';
import { BYTES_PER_DOUBLE } from 'Parser/GTXParser';
diff --git a/src/Parser/GTXParser.js b/packages/Main/src/Parser/GTXParser.js
similarity index 98%
rename from src/Parser/GTXParser.js
rename to packages/Main/src/Parser/GTXParser.js
index 5fbbe0c40b..a061c9e076 100644
--- a/src/Parser/GTXParser.js
+++ b/packages/Main/src/Parser/GTXParser.js
@@ -1,7 +1,6 @@
import * as THREE from 'three';
+import { Extent } from '@itowns/geographic';
import GeoidGrid from 'Core/Geographic/GeoidGrid';
-import Extent from 'Core/Geographic/Extent';
-
export const BYTES_PER_DOUBLE = 8;
export const BYTES_PER_FLOAT = 4;
diff --git a/src/Parser/GeoJsonParser.js b/packages/Main/src/Parser/GeoJsonParser.js
similarity index 99%
rename from src/Parser/GeoJsonParser.js
rename to packages/Main/src/Parser/GeoJsonParser.js
index 4049736064..4f881d229e 100644
--- a/src/Parser/GeoJsonParser.js
+++ b/packages/Main/src/Parser/GeoJsonParser.js
@@ -1,4 +1,4 @@
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import { FeatureCollection, FEATURE_TYPES } from 'Core/Feature';
import { deprecatedParsingOptionsToNewOne } from 'Core/Deprecated/Undeprecator';
diff --git a/src/Parser/GpxParser.js b/packages/Main/src/Parser/GpxParser.js
similarity index 100%
rename from src/Parser/GpxParser.js
rename to packages/Main/src/Parser/GpxParser.js
diff --git a/src/Parser/ISGParser.js b/packages/Main/src/Parser/ISGParser.js
similarity index 98%
rename from src/Parser/ISGParser.js
rename to packages/Main/src/Parser/ISGParser.js
index 6c9d241575..3a18c857c7 100644
--- a/src/Parser/ISGParser.js
+++ b/packages/Main/src/Parser/ISGParser.js
@@ -1,6 +1,6 @@
import * as THREE from 'three';
+import { Extent } from '@itowns/geographic';
import GeoidGrid from 'Core/Geographic/GeoidGrid';
-import Extent from 'Core/Geographic/Extent';
import { getHeaderAttribute } from 'Parser/GDFParser';
import { BYTES_PER_DOUBLE } from 'Parser/GTXParser';
diff --git a/src/Parser/KMLParser.js b/packages/Main/src/Parser/KMLParser.js
similarity index 100%
rename from src/Parser/KMLParser.js
rename to packages/Main/src/Parser/KMLParser.js
diff --git a/src/Parser/LASParser.js b/packages/Main/src/Parser/LASParser.js
similarity index 100%
rename from src/Parser/LASParser.js
rename to packages/Main/src/Parser/LASParser.js
diff --git a/src/Parser/MapBoxUrlParser.js b/packages/Main/src/Parser/MapBoxUrlParser.js
similarity index 100%
rename from src/Parser/MapBoxUrlParser.js
rename to packages/Main/src/Parser/MapBoxUrlParser.js
diff --git a/src/Parser/PntsParser.js b/packages/Main/src/Parser/PntsParser.js
similarity index 100%
rename from src/Parser/PntsParser.js
rename to packages/Main/src/Parser/PntsParser.js
diff --git a/src/Parser/Potree2BinParser.js b/packages/Main/src/Parser/Potree2BinParser.js
similarity index 100%
rename from src/Parser/Potree2BinParser.js
rename to packages/Main/src/Parser/Potree2BinParser.js
diff --git a/src/Parser/PotreeBinParser.js b/packages/Main/src/Parser/PotreeBinParser.js
similarity index 100%
rename from src/Parser/PotreeBinParser.js
rename to packages/Main/src/Parser/PotreeBinParser.js
diff --git a/src/Parser/PotreeCinParser.js b/packages/Main/src/Parser/PotreeCinParser.js
similarity index 100%
rename from src/Parser/PotreeCinParser.js
rename to packages/Main/src/Parser/PotreeCinParser.js
diff --git a/src/Parser/ShapefileParser.js b/packages/Main/src/Parser/ShapefileParser.js
similarity index 100%
rename from src/Parser/ShapefileParser.js
rename to packages/Main/src/Parser/ShapefileParser.js
diff --git a/src/Parser/VectorTileParser.js b/packages/Main/src/Parser/VectorTileParser.js
similarity index 99%
rename from src/Parser/VectorTileParser.js
rename to packages/Main/src/Parser/VectorTileParser.js
index bff52dc251..850b2bf956 100644
--- a/src/Parser/VectorTileParser.js
+++ b/packages/Main/src/Parser/VectorTileParser.js
@@ -1,10 +1,10 @@
import { Vector2, Vector3 } from 'three';
import Protobuf from 'pbf';
import { VectorTile } from '@mapbox/vector-tile';
-import { globalExtentTMS } from 'Core/Tile/TileGrid';
import { FeatureCollection, FEATURE_TYPES } from 'Core/Feature';
+import { globalExtentTMS } from 'Core/Tile/TileGrid';
import { deprecatedParsingOptionsToNewOne } from 'Core/Deprecated/Undeprecator';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
const worldDimension3857 = globalExtentTMS.get('EPSG:3857').planarDimensions();
const globalExtent = new Vector3(worldDimension3857.x, worldDimension3857.y, 1);
diff --git a/src/Parser/XbilParser.js b/packages/Main/src/Parser/XbilParser.js
similarity index 100%
rename from src/Parser/XbilParser.js
rename to packages/Main/src/Parser/XbilParser.js
diff --git a/src/Parser/deprecated/LegacyGLTFLoader.js b/packages/Main/src/Parser/deprecated/LegacyGLTFLoader.js
similarity index 100%
rename from src/Parser/deprecated/LegacyGLTFLoader.js
rename to packages/Main/src/Parser/deprecated/LegacyGLTFLoader.js
diff --git a/src/Parser/iGLTFLoader.js b/packages/Main/src/Parser/iGLTFLoader.js
similarity index 100%
rename from src/Parser/iGLTFLoader.js
rename to packages/Main/src/Parser/iGLTFLoader.js
diff --git a/src/Process/3dTilesProcessing.js b/packages/Main/src/Process/3dTilesProcessing.js
similarity index 100%
rename from src/Process/3dTilesProcessing.js
rename to packages/Main/src/Process/3dTilesProcessing.js
diff --git a/src/Process/FeatureProcessing.js b/packages/Main/src/Process/FeatureProcessing.js
similarity index 98%
rename from src/Process/FeatureProcessing.js
rename to packages/Main/src/Process/FeatureProcessing.js
index 29d1c9efcb..1a49308fa9 100644
--- a/src/Process/FeatureProcessing.js
+++ b/packages/Main/src/Process/FeatureProcessing.js
@@ -1,7 +1,7 @@
import LayerUpdateState from 'Layer/LayerUpdateState';
import ObjectRemovalHelper from 'Process/ObjectRemovalHelper';
import handlingError from 'Process/handlerNodeError';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import { geoidLayerIsVisible } from 'Layer/GeoidLayer';
const coord = new Coordinates('EPSG:4326', 0, 0, 0);
diff --git a/src/Process/LayeredMaterialNodeProcessing.js b/packages/Main/src/Process/LayeredMaterialNodeProcessing.js
similarity index 100%
rename from src/Process/LayeredMaterialNodeProcessing.js
rename to packages/Main/src/Process/LayeredMaterialNodeProcessing.js
diff --git a/src/Process/ObjectRemovalHelper.js b/packages/Main/src/Process/ObjectRemovalHelper.js
similarity index 100%
rename from src/Process/ObjectRemovalHelper.js
rename to packages/Main/src/Process/ObjectRemovalHelper.js
diff --git a/src/Process/handlerNodeError.js b/packages/Main/src/Process/handlerNodeError.js
similarity index 100%
rename from src/Process/handlerNodeError.js
rename to packages/Main/src/Process/handlerNodeError.js
diff --git a/src/Provider/3dTilesProvider.js b/packages/Main/src/Provider/3dTilesProvider.js
similarity index 100%
rename from src/Provider/3dTilesProvider.js
rename to packages/Main/src/Provider/3dTilesProvider.js
diff --git a/src/Provider/DataSourceProvider.js b/packages/Main/src/Provider/DataSourceProvider.js
similarity index 100%
rename from src/Provider/DataSourceProvider.js
rename to packages/Main/src/Provider/DataSourceProvider.js
diff --git a/src/Provider/Fetcher.js b/packages/Main/src/Provider/Fetcher.js
similarity index 100%
rename from src/Provider/Fetcher.js
rename to packages/Main/src/Provider/Fetcher.js
diff --git a/src/Provider/PointCloudProvider.js b/packages/Main/src/Provider/PointCloudProvider.js
similarity index 97%
rename from src/Provider/PointCloudProvider.js
rename to packages/Main/src/Provider/PointCloudProvider.js
index 57e24bcbf5..d36d3fd5c0 100644
--- a/src/Provider/PointCloudProvider.js
+++ b/packages/Main/src/Provider/PointCloudProvider.js
@@ -1,5 +1,5 @@
import * as THREE from 'three';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
let nextuuid = 1;
function addPickingAttribute(points) {
diff --git a/src/Provider/TileProvider.js b/packages/Main/src/Provider/TileProvider.js
similarity index 100%
rename from src/Provider/TileProvider.js
rename to packages/Main/src/Provider/TileProvider.js
diff --git a/src/Provider/URLBuilder.js b/packages/Main/src/Provider/URLBuilder.js
similarity index 100%
rename from src/Provider/URLBuilder.js
rename to packages/Main/src/Provider/URLBuilder.js
diff --git a/src/Renderer/Camera.js b/packages/Main/src/Renderer/Camera.js
similarity index 99%
rename from src/Renderer/Camera.js
rename to packages/Main/src/Renderer/Camera.js
index 848936cf2b..4fe7bd18b4 100644
--- a/src/Renderer/Camera.js
+++ b/packages/Main/src/Renderer/Camera.js
@@ -1,5 +1,5 @@
import * as THREE from 'three';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import DEMUtils from 'Utils/DEMUtils';
/**
diff --git a/src/Renderer/Color.js b/packages/Main/src/Renderer/Color.js
similarity index 100%
rename from src/Renderer/Color.js
rename to packages/Main/src/Renderer/Color.js
diff --git a/src/Renderer/ColorLayersOrdering.js b/packages/Main/src/Renderer/ColorLayersOrdering.js
similarity index 100%
rename from src/Renderer/ColorLayersOrdering.js
rename to packages/Main/src/Renderer/ColorLayersOrdering.js
diff --git a/src/Renderer/CommonMaterial.js b/packages/Main/src/Renderer/CommonMaterial.js
similarity index 100%
rename from src/Renderer/CommonMaterial.js
rename to packages/Main/src/Renderer/CommonMaterial.js
diff --git a/src/Renderer/Label2DRenderer.js b/packages/Main/src/Renderer/Label2DRenderer.js
similarity index 100%
rename from src/Renderer/Label2DRenderer.js
rename to packages/Main/src/Renderer/Label2DRenderer.js
diff --git a/src/Renderer/LayeredMaterial.js b/packages/Main/src/Renderer/LayeredMaterial.js
similarity index 98%
rename from src/Renderer/LayeredMaterial.js
rename to packages/Main/src/Renderer/LayeredMaterial.js
index bf1d50c2bc..0e988591a1 100644
--- a/src/Renderer/LayeredMaterial.js
+++ b/packages/Main/src/Renderer/LayeredMaterial.js
@@ -1,10 +1,10 @@
import * as THREE from 'three';
-import TileVS from 'Renderer/Shader/TileVS.glsl';
-import TileFS from 'Renderer/Shader/TileFS.glsl';
import ShaderUtils from 'Renderer/Shader/ShaderUtils';
import Capabilities from 'Core/System/Capabilities';
import RenderMode from 'Renderer/RenderMode';
import CommonMaterial from 'Renderer/CommonMaterial';
+import TileVS from '../Renderer/Shader/TileVS.glsl';
+import TileFS from '../Renderer/Shader/TileFS.glsl';
const identityOffsetScale = new THREE.Vector4(0.0, 0.0, 1.0, 1.0);
const defaultTex = new THREE.Texture();
diff --git a/src/Renderer/OBB.js b/packages/Main/src/Renderer/OBB.js
similarity index 98%
rename from src/Renderer/OBB.js
rename to packages/Main/src/Renderer/OBB.js
index 5b763b6b00..b42058dac6 100644
--- a/src/Renderer/OBB.js
+++ b/packages/Main/src/Renderer/OBB.js
@@ -1,8 +1,7 @@
import * as THREE from 'three';
-import * as CRS from 'Core/Geographic/Crs';
import { TileGeometry } from 'Core/TileGeometry';
import { GlobeTileBuilder } from 'Core/Prefab/Globe/GlobeTileBuilder';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { CRS, Coordinates } from '@itowns/geographic';
// get oriented bounding box of tile
const builder = new GlobeTileBuilder({ uvCount: 1 });
diff --git a/src/Renderer/OrientedImageCamera.js b/packages/Main/src/Renderer/OrientedImageCamera.js
similarity index 100%
rename from src/Renderer/OrientedImageCamera.js
rename to packages/Main/src/Renderer/OrientedImageCamera.js
diff --git a/src/Renderer/OrientedImageMaterial.js b/packages/Main/src/Renderer/OrientedImageMaterial.js
similarity index 98%
rename from src/Renderer/OrientedImageMaterial.js
rename to packages/Main/src/Renderer/OrientedImageMaterial.js
index c22545acff..2ce6087b52 100644
--- a/src/Renderer/OrientedImageMaterial.js
+++ b/packages/Main/src/Renderer/OrientedImageMaterial.js
@@ -1,8 +1,8 @@
import * as THREE from 'three';
import Capabilities from 'Core/System/Capabilities';
-import textureVS from 'Renderer/Shader/ProjectiveTextureVS.glsl';
-import textureFS from 'Renderer/Shader/ProjectiveTextureFS.glsl';
import ShaderUtils from 'Renderer/Shader/ShaderUtils';
+import textureVS from './Shader/ProjectiveTextureVS.glsl';
+import textureFS from './Shader/ProjectiveTextureFS.glsl';
const ndcToTextureMatrix = new THREE.Matrix4(
1, 0, 0, 1,
diff --git a/src/Renderer/PointsMaterial.js b/packages/Main/src/Renderer/PointsMaterial.js
similarity index 100%
rename from src/Renderer/PointsMaterial.js
rename to packages/Main/src/Renderer/PointsMaterial.js
diff --git a/src/Renderer/RasterTile.js b/packages/Main/src/Renderer/RasterTile.js
similarity index 100%
rename from src/Renderer/RasterTile.js
rename to packages/Main/src/Renderer/RasterTile.js
diff --git a/src/Renderer/RenderMode.js b/packages/Main/src/Renderer/RenderMode.js
similarity index 100%
rename from src/Renderer/RenderMode.js
rename to packages/Main/src/Renderer/RenderMode.js
diff --git a/src/Renderer/Shader/Chunk/color_layers_pars_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/color_layers_pars_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/color_layers_pars_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/color_layers_pars_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/elevation_pars_vertex.glsl b/packages/Main/src/Renderer/Shader/Chunk/elevation_pars_vertex.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/elevation_pars_vertex.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/elevation_pars_vertex.glsl
diff --git a/src/Renderer/Shader/Chunk/elevation_vertex.glsl b/packages/Main/src/Renderer/Shader/Chunk/elevation_vertex.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/elevation_vertex.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/elevation_vertex.glsl
diff --git a/src/Renderer/Shader/Chunk/fog_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/fog_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/fog_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/fog_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/fog_pars_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/fog_pars_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/fog_pars_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/fog_pars_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/geoid_vertex.glsl b/packages/Main/src/Renderer/Shader/Chunk/geoid_vertex.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/geoid_vertex.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/geoid_vertex.glsl
diff --git a/src/Renderer/Shader/Chunk/lighting_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/lighting_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/lighting_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/lighting_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/lighting_pars_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/lighting_pars_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/lighting_pars_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/lighting_pars_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/mode_depth_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/mode_depth_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/mode_depth_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/mode_depth_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/mode_id_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/mode_id_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/mode_id_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/mode_id_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/mode_pars_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/mode_pars_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/mode_pars_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/mode_pars_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/overlay_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/overlay_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/overlay_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/overlay_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/overlay_pars_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/overlay_pars_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/overlay_pars_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/overlay_pars_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/pitUV.glsl b/packages/Main/src/Renderer/Shader/Chunk/pitUV.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/pitUV.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/pitUV.glsl
diff --git a/src/Renderer/Shader/Chunk/precision_qualifier.glsl b/packages/Main/src/Renderer/Shader/Chunk/precision_qualifier.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/precision_qualifier.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/precision_qualifier.glsl
diff --git a/src/Renderer/Shader/Chunk/projective_texturing_pars_fragment.glsl b/packages/Main/src/Renderer/Shader/Chunk/projective_texturing_pars_fragment.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/projective_texturing_pars_fragment.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/projective_texturing_pars_fragment.glsl
diff --git a/src/Renderer/Shader/Chunk/projective_texturing_pars_vertex.glsl b/packages/Main/src/Renderer/Shader/Chunk/projective_texturing_pars_vertex.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/projective_texturing_pars_vertex.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/projective_texturing_pars_vertex.glsl
diff --git a/src/Renderer/Shader/Chunk/projective_texturing_vertex.glsl b/packages/Main/src/Renderer/Shader/Chunk/projective_texturing_vertex.glsl
similarity index 100%
rename from src/Renderer/Shader/Chunk/projective_texturing_vertex.glsl
rename to packages/Main/src/Renderer/Shader/Chunk/projective_texturing_vertex.glsl
diff --git a/src/Renderer/Shader/PointsFS.glsl b/packages/Main/src/Renderer/Shader/PointsFS.glsl
similarity index 100%
rename from src/Renderer/Shader/PointsFS.glsl
rename to packages/Main/src/Renderer/Shader/PointsFS.glsl
diff --git a/src/Renderer/Shader/PointsVS.glsl b/packages/Main/src/Renderer/Shader/PointsVS.glsl
similarity index 100%
rename from src/Renderer/Shader/PointsVS.glsl
rename to packages/Main/src/Renderer/Shader/PointsVS.glsl
diff --git a/src/Renderer/Shader/ProjectiveTextureFS.glsl b/packages/Main/src/Renderer/Shader/ProjectiveTextureFS.glsl
similarity index 100%
rename from src/Renderer/Shader/ProjectiveTextureFS.glsl
rename to packages/Main/src/Renderer/Shader/ProjectiveTextureFS.glsl
diff --git a/src/Renderer/Shader/ProjectiveTextureVS.glsl b/packages/Main/src/Renderer/Shader/ProjectiveTextureVS.glsl
similarity index 100%
rename from src/Renderer/Shader/ProjectiveTextureVS.glsl
rename to packages/Main/src/Renderer/Shader/ProjectiveTextureVS.glsl
diff --git a/src/Renderer/Shader/SampleTestFS.glsl b/packages/Main/src/Renderer/Shader/SampleTestFS.glsl
similarity index 100%
rename from src/Renderer/Shader/SampleTestFS.glsl
rename to packages/Main/src/Renderer/Shader/SampleTestFS.glsl
diff --git a/src/Renderer/Shader/SampleTestVS.glsl b/packages/Main/src/Renderer/Shader/SampleTestVS.glsl
similarity index 100%
rename from src/Renderer/Shader/SampleTestVS.glsl
rename to packages/Main/src/Renderer/Shader/SampleTestVS.glsl
diff --git a/src/Renderer/Shader/ShaderChunk.js b/packages/Main/src/Renderer/Shader/ShaderChunk.js
similarity index 100%
rename from src/Renderer/Shader/ShaderChunk.js
rename to packages/Main/src/Renderer/Shader/ShaderChunk.js
diff --git a/src/Renderer/Shader/ShaderUtils.js b/packages/Main/src/Renderer/Shader/ShaderUtils.js
similarity index 100%
rename from src/Renderer/Shader/ShaderUtils.js
rename to packages/Main/src/Renderer/Shader/ShaderUtils.js
diff --git a/src/Renderer/Shader/TileFS.glsl b/packages/Main/src/Renderer/Shader/TileFS.glsl
similarity index 100%
rename from src/Renderer/Shader/TileFS.glsl
rename to packages/Main/src/Renderer/Shader/TileFS.glsl
diff --git a/src/Renderer/Shader/TileVS.glsl b/packages/Main/src/Renderer/Shader/TileVS.glsl
similarity index 100%
rename from src/Renderer/Shader/TileVS.glsl
rename to packages/Main/src/Renderer/Shader/TileVS.glsl
diff --git a/src/Renderer/SphereHelper.js b/packages/Main/src/Renderer/SphereHelper.js
similarity index 100%
rename from src/Renderer/SphereHelper.js
rename to packages/Main/src/Renderer/SphereHelper.js
diff --git a/src/Renderer/WebXR.js b/packages/Main/src/Renderer/WebXR.js
similarity index 100%
rename from src/Renderer/WebXR.js
rename to packages/Main/src/Renderer/WebXR.js
diff --git a/src/Renderer/c3DEngine.js b/packages/Main/src/Renderer/c3DEngine.js
similarity index 100%
rename from src/Renderer/c3DEngine.js
rename to packages/Main/src/Renderer/c3DEngine.js
index 240053e5ea..a6b99b0768 100644
--- a/src/Renderer/c3DEngine.js
+++ b/packages/Main/src/Renderer/c3DEngine.js
@@ -7,9 +7,9 @@
import * as THREE from 'three';
import Capabilities from 'Core/System/Capabilities';
import { unpack1K } from 'Renderer/LayeredMaterial';
-import WEBGL from 'ThreeExtended/capabilities/WebGL';
import Label2DRenderer from 'Renderer/Label2DRenderer';
import { deprecatedC3DEngineWebGLOptions } from 'Core/Deprecated/Undeprecator';
+import WEBGL from 'ThreeExtended/capabilities/WebGL';
const depthRGBA = new THREE.Vector4();
class c3DEngine {
diff --git a/src/Source/C3DTilesGoogleSource.js b/packages/Main/src/Source/C3DTilesGoogleSource.js
similarity index 100%
rename from src/Source/C3DTilesGoogleSource.js
rename to packages/Main/src/Source/C3DTilesGoogleSource.js
diff --git a/src/Source/C3DTilesIonSource.js b/packages/Main/src/Source/C3DTilesIonSource.js
similarity index 100%
rename from src/Source/C3DTilesIonSource.js
rename to packages/Main/src/Source/C3DTilesIonSource.js
diff --git a/src/Source/C3DTilesSource.js b/packages/Main/src/Source/C3DTilesSource.js
similarity index 100%
rename from src/Source/C3DTilesSource.js
rename to packages/Main/src/Source/C3DTilesSource.js
diff --git a/src/Source/CopcSource.js b/packages/Main/src/Source/CopcSource.js
similarity index 99%
rename from src/Source/CopcSource.js
rename to packages/Main/src/Source/CopcSource.js
index 905c600803..15cdd43c4b 100644
--- a/src/Source/CopcSource.js
+++ b/packages/Main/src/Source/CopcSource.js
@@ -1,5 +1,5 @@
import { Binary, Info, Las } from 'copc';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
import Fetcher from 'Provider/Fetcher';
import LASParser from 'Parser/LASParser';
import Source from 'Source/Source';
diff --git a/src/Source/EntwinePointTileSource.js b/packages/Main/src/Source/EntwinePointTileSource.js
similarity index 100%
rename from src/Source/EntwinePointTileSource.js
rename to packages/Main/src/Source/EntwinePointTileSource.js
diff --git a/src/Source/FileSource.js b/packages/Main/src/Source/FileSource.js
similarity index 100%
rename from src/Source/FileSource.js
rename to packages/Main/src/Source/FileSource.js
diff --git a/src/Source/OGC3DTilesGoogleSource.js b/packages/Main/src/Source/OGC3DTilesGoogleSource.js
similarity index 100%
rename from src/Source/OGC3DTilesGoogleSource.js
rename to packages/Main/src/Source/OGC3DTilesGoogleSource.js
diff --git a/src/Source/OGC3DTilesIonSource.js b/packages/Main/src/Source/OGC3DTilesIonSource.js
similarity index 100%
rename from src/Source/OGC3DTilesIonSource.js
rename to packages/Main/src/Source/OGC3DTilesIonSource.js
diff --git a/src/Source/OGC3DTilesSource.js b/packages/Main/src/Source/OGC3DTilesSource.js
similarity index 100%
rename from src/Source/OGC3DTilesSource.js
rename to packages/Main/src/Source/OGC3DTilesSource.js
diff --git a/src/Source/OrientedImageSource.js b/packages/Main/src/Source/OrientedImageSource.js
similarity index 100%
rename from src/Source/OrientedImageSource.js
rename to packages/Main/src/Source/OrientedImageSource.js
diff --git a/src/Source/Potree2Source.js b/packages/Main/src/Source/Potree2Source.js
similarity index 100%
rename from src/Source/Potree2Source.js
rename to packages/Main/src/Source/Potree2Source.js
diff --git a/src/Source/PotreeSource.js b/packages/Main/src/Source/PotreeSource.js
similarity index 100%
rename from src/Source/PotreeSource.js
rename to packages/Main/src/Source/PotreeSource.js
diff --git a/src/Source/Source.js b/packages/Main/src/Source/Source.js
similarity index 98%
rename from src/Source/Source.js
rename to packages/Main/src/Source/Source.js
index 491e2de0c6..cb7e40cb54 100644
--- a/src/Source/Source.js
+++ b/packages/Main/src/Source/Source.js
@@ -1,5 +1,4 @@
-import * as CRS from 'Core/Geographic/Crs';
-import Extent from 'Core/Geographic/Extent';
+import { Extent, CRS } from '@itowns/geographic';
import GeoJsonParser from 'Parser/GeoJsonParser';
import KMLParser from 'Parser/KMLParser';
import GDFParser from 'Parser/GDFParser';
diff --git a/src/Source/TMSSource.js b/packages/Main/src/Source/TMSSource.js
similarity index 99%
rename from src/Source/TMSSource.js
rename to packages/Main/src/Source/TMSSource.js
index 6d669ceec3..318089bfac 100644
--- a/src/Source/TMSSource.js
+++ b/packages/Main/src/Source/TMSSource.js
@@ -1,8 +1,8 @@
import Source from 'Source/Source';
import URLBuilder from 'Provider/URLBuilder';
-import Extent from 'Core/Geographic/Extent';
-import Tile from 'Core/Tile/Tile';
+import { Extent } from '@itowns/geographic';
import { globalExtentTMS } from 'Core/Tile/TileGrid';
+import Tile from 'Core/Tile/Tile';
const _tile = new Tile('EPSG:4326', 0, 0, 0);
diff --git a/src/Source/VectorTilesSource.js b/packages/Main/src/Source/VectorTilesSource.js
similarity index 100%
rename from src/Source/VectorTilesSource.js
rename to packages/Main/src/Source/VectorTilesSource.js
diff --git a/src/Source/WFSSource.js b/packages/Main/src/Source/WFSSource.js
similarity index 99%
rename from src/Source/WFSSource.js
rename to packages/Main/src/Source/WFSSource.js
index 5d2c771fa6..42688acc62 100644
--- a/src/Source/WFSSource.js
+++ b/packages/Main/src/Source/WFSSource.js
@@ -1,6 +1,6 @@
import Source from 'Source/Source';
import URLBuilder from 'Provider/URLBuilder';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
const _extent = new Extent('EPSG:4326', [0, 0, 0, 0]);
diff --git a/src/Source/WMSSource.js b/packages/Main/src/Source/WMSSource.js
similarity index 99%
rename from src/Source/WMSSource.js
rename to packages/Main/src/Source/WMSSource.js
index c6217165da..0031eae9b7 100644
--- a/src/Source/WMSSource.js
+++ b/packages/Main/src/Source/WMSSource.js
@@ -1,6 +1,6 @@
import Source from 'Source/Source';
import URLBuilder from 'Provider/URLBuilder';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
const _extent = new Extent('EPSG:4326', [0, 0, 0, 0]);
diff --git a/src/Source/WMTSSource.js b/packages/Main/src/Source/WMTSSource.js
similarity index 100%
rename from src/Source/WMTSSource.js
rename to packages/Main/src/Source/WMTSSource.js
diff --git a/src/Utils/CameraUtils.js b/packages/Main/src/Utils/CameraUtils.js
similarity index 99%
rename from src/Utils/CameraUtils.js
rename to packages/Main/src/Utils/CameraUtils.js
index 5bccc8ece6..11d1fd0e95 100644
--- a/src/Utils/CameraUtils.js
+++ b/packages/Main/src/Utils/CameraUtils.js
@@ -2,8 +2,7 @@ import * as THREE from 'three';
import TWEEN from '@tweenjs/tween.js';
import DEMUtils from 'Utils/DEMUtils';
import { MAIN_LOOP_EVENTS } from 'Core/MainLoop';
-import Coordinates from 'Core/Geographic/Coordinates';
-import Ellipsoid from 'Core/Math/Ellipsoid';
+import { Coordinates, Ellipsoid } from '@itowns/geographic';
import OBB from 'Renderer/OBB';
import { VIEW_EVENTS } from 'Core/View';
diff --git a/src/Utils/DEMUtils.js b/packages/Main/src/Utils/DEMUtils.js
similarity index 99%
rename from src/Utils/DEMUtils.js
rename to packages/Main/src/Utils/DEMUtils.js
index d4ad018c7a..5bb8bfa077 100644
--- a/src/Utils/DEMUtils.js
+++ b/packages/Main/src/Utils/DEMUtils.js
@@ -1,5 +1,5 @@
import * as THREE from 'three';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import placeObjectOnGround from 'Utils/placeObjectOnGround';
const FAST_READ_Z = 0;
diff --git a/src/Utils/FeaturesUtils.js b/packages/Main/src/Utils/FeaturesUtils.js
similarity index 99%
rename from src/Utils/FeaturesUtils.js
rename to packages/Main/src/Utils/FeaturesUtils.js
index 005efe5c5c..d5928a94ac 100644
--- a/src/Utils/FeaturesUtils.js
+++ b/packages/Main/src/Utils/FeaturesUtils.js
@@ -1,5 +1,5 @@
import { FEATURE_TYPES } from 'Core/Feature';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
function pointIsOverLine(point, linePoints, epsilon, offset, count, size) {
const x0 = point.x;
diff --git a/src/Utils/Gradients.js b/packages/Main/src/Utils/Gradients.js
similarity index 100%
rename from src/Utils/Gradients.js
rename to packages/Main/src/Utils/Gradients.js
diff --git a/src/Utils/ThreeUtils.js b/packages/Main/src/Utils/ThreeUtils.js
similarity index 100%
rename from src/Utils/ThreeUtils.js
rename to packages/Main/src/Utils/ThreeUtils.js
diff --git a/src/Utils/placeObjectOnGround.js b/packages/Main/src/Utils/placeObjectOnGround.js
similarity index 99%
rename from src/Utils/placeObjectOnGround.js
rename to packages/Main/src/Utils/placeObjectOnGround.js
index 887d183cb0..60c309d2a7 100644
--- a/src/Utils/placeObjectOnGround.js
+++ b/packages/Main/src/Utils/placeObjectOnGround.js
@@ -1,6 +1,6 @@
import * as THREE from 'three';
+import { Coordinates } from '@itowns/geographic';
import DEMUtils from 'Utils/DEMUtils';
-import Coordinates from 'Core/Geographic/Coordinates';
const temp = {
v: new THREE.Vector3(),
diff --git a/src/Worker/LASLoaderWorker.js b/packages/Main/src/Worker/LASLoaderWorker.js
similarity index 100%
rename from src/Worker/LASLoaderWorker.js
rename to packages/Main/src/Worker/LASLoaderWorker.js
diff --git a/src/Worker/Potree2Worker.js b/packages/Main/src/Worker/Potree2Worker.js
similarity index 100%
rename from src/Worker/Potree2Worker.js
rename to packages/Main/src/Worker/Potree2Worker.js
diff --git a/packages/Main/test/.eslintrc.cjs b/packages/Main/test/.eslintrc.cjs
new file mode 100644
index 0000000000..28b3eb003d
--- /dev/null
+++ b/packages/Main/test/.eslintrc.cjs
@@ -0,0 +1,9 @@
+module.exports = {
+ rules: {
+ 'func-names': 'off',
+ 'prefer-arrow-callback': 'off',
+ },
+ env: {
+ mocha: true,
+ },
+};
diff --git a/test/data/EGM2008_simplified.gdf b/packages/Main/test/data/EGM2008_simplified.gdf
similarity index 100%
rename from test/data/EGM2008_simplified.gdf
rename to packages/Main/test/data/EGM2008_simplified.gdf
diff --git a/test/data/OrientedImage/cameraCalibration.json b/packages/Main/test/data/OrientedImage/cameraCalibration.json
similarity index 100%
rename from test/data/OrientedImage/cameraCalibration.json
rename to packages/Main/test/data/OrientedImage/cameraCalibration.json
diff --git a/test/data/OrientedImage/panoramicsMetaDataParis.geojson b/packages/Main/test/data/OrientedImage/panoramicsMetaDataParis.geojson
similarity index 100%
rename from test/data/OrientedImage/panoramicsMetaDataParis.geojson
rename to packages/Main/test/data/OrientedImage/panoramicsMetaDataParis.geojson
diff --git a/test/data/entwine/ept-hierarchy/0-0-0-0.json b/packages/Main/test/data/entwine/ept-hierarchy/0-0-0-0.json
similarity index 100%
rename from test/data/entwine/ept-hierarchy/0-0-0-0.json
rename to packages/Main/test/data/entwine/ept-hierarchy/0-0-0-0.json
diff --git a/test/data/entwine/ept.json b/packages/Main/test/data/entwine/ept.json
similarity index 100%
rename from test/data/entwine/ept.json
rename to packages/Main/test/data/entwine/ept.json
diff --git a/test/data/filesource/featCollec_Polygone.geojson b/packages/Main/test/data/filesource/featCollec_Polygone.geojson
similarity index 100%
rename from test/data/filesource/featCollec_Polygone.geojson
rename to packages/Main/test/data/filesource/featCollec_Polygone.geojson
diff --git a/test/data/filesource/feat_Polygone.geojson b/packages/Main/test/data/filesource/feat_Polygone.geojson
similarity index 100%
rename from test/data/filesource/feat_Polygone.geojson
rename to packages/Main/test/data/filesource/feat_Polygone.geojson
diff --git a/test/data/geojson/gpx.geojson b/packages/Main/test/data/geojson/gpx.geojson
similarity index 100%
rename from test/data/geojson/gpx.geojson
rename to packages/Main/test/data/geojson/gpx.geojson
diff --git a/test/data/geojson/holes.geojson b/packages/Main/test/data/geojson/holes.geojson
similarity index 100%
rename from test/data/geojson/holes.geojson
rename to packages/Main/test/data/geojson/holes.geojson
diff --git a/test/data/geojson/holesPoints.geojson b/packages/Main/test/data/geojson/holesPoints.geojson
similarity index 100%
rename from test/data/geojson/holesPoints.geojson
rename to packages/Main/test/data/geojson/holesPoints.geojson
diff --git a/test/data/geojson/map.geojson b/packages/Main/test/data/geojson/map.geojson
similarity index 100%
rename from test/data/geojson/map.geojson
rename to packages/Main/test/data/geojson/map.geojson
diff --git a/test/data/geojson/map_big.geojson b/packages/Main/test/data/geojson/map_big.geojson
similarity index 100%
rename from test/data/geojson/map_big.geojson
rename to packages/Main/test/data/geojson/map_big.geojson
diff --git a/test/data/geojson/map_small.geojson b/packages/Main/test/data/geojson/map_small.geojson
similarity index 100%
rename from test/data/geojson/map_small.geojson
rename to packages/Main/test/data/geojson/map_small.geojson
diff --git a/test/data/geojson/points.geojson b/packages/Main/test/data/geojson/points.geojson
similarity index 100%
rename from test/data/geojson/points.geojson
rename to packages/Main/test/data/geojson/points.geojson
diff --git a/test/data/geojson/simple.geojson b/packages/Main/test/data/geojson/simple.geojson
similarity index 100%
rename from test/data/geojson/simple.geojson
rename to packages/Main/test/data/geojson/simple.geojson
diff --git a/test/data/gltf/box.glb b/packages/Main/test/data/gltf/box.glb
similarity index 100%
rename from test/data/gltf/box.glb
rename to packages/Main/test/data/gltf/box.glb
diff --git a/test/data/mapboxMulti.json b/packages/Main/test/data/mapboxMulti.json
similarity index 100%
rename from test/data/mapboxMulti.json
rename to packages/Main/test/data/mapboxMulti.json
diff --git a/test/data/pbf/multipolygon.pbf b/packages/Main/test/data/pbf/multipolygon.pbf
similarity index 100%
rename from test/data/pbf/multipolygon.pbf
rename to packages/Main/test/data/pbf/multipolygon.pbf
diff --git a/test/data/raf09_simplified.isg b/packages/Main/test/data/raf09_simplified.isg
similarity index 100%
rename from test/data/raf09_simplified.isg
rename to packages/Main/test/data/raf09_simplified.isg
diff --git a/test/data/vectortiles/sprite.json b/packages/Main/test/data/vectortiles/sprite.json
similarity index 100%
rename from test/data/vectortiles/sprite.json
rename to packages/Main/test/data/vectortiles/sprite.json
diff --git a/test/data/vectortiles/style.json b/packages/Main/test/data/vectortiles/style.json
similarity index 100%
rename from test/data/vectortiles/style.json
rename to packages/Main/test/data/vectortiles/style.json
diff --git a/test/data/vectortiles/tilejson.json b/packages/Main/test/data/vectortiles/tilejson.json
similarity index 100%
rename from test/data/vectortiles/tilejson.json
rename to packages/Main/test/data/vectortiles/tilejson.json
diff --git a/test/unit/3dtiles.js b/packages/Main/test/unit/3dtiles.js
similarity index 97%
rename from test/unit/3dtiles.js
rename to packages/Main/test/unit/3dtiles.js
index c5ac00d76a..a741af167d 100644
--- a/test/unit/3dtiles.js
+++ b/packages/Main/test/unit/3dtiles.js
@@ -1,8 +1,7 @@
-import proj4 from 'proj4';
import assert from 'assert';
import { Matrix4, Object3D, Sphere } from 'three';
import Camera from 'Renderer/Camera';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates, CRS } from '@itowns/geographic';
import { computeNodeSSE } from 'Process/3dTilesProcessing';
import { configureTile } from 'Provider/3dTilesProvider';
import C3DTileset from '../../src/Core/3DTiles/C3DTileset';
@@ -93,7 +92,7 @@ describe('Distance computation for boundingVolume region', function () {
});
describe('Distance computation for boundingVolume box', function () {
- proj4.defs('EPSG:3946',
+ CRS.defs('EPSG:3946',
'+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
const camera = new Camera('EPSG:3946', 100, 100);
@@ -131,7 +130,7 @@ describe('Distance computation for boundingVolume box', function () {
});
describe('Distance computation for boundingVolume sphere', function () {
- proj4.defs('EPSG:3946',
+ CRS.defs('EPSG:3946',
'+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
const camera = new Camera('EPSG:3946', 100, 100);
diff --git a/test/unit/3dtilesbatchtable.js b/packages/Main/test/unit/3dtilesbatchtable.js
similarity index 100%
rename from test/unit/3dtilesbatchtable.js
rename to packages/Main/test/unit/3dtilesbatchtable.js
diff --git a/test/unit/3dtilesbatchtablehierarchy.js b/packages/Main/test/unit/3dtilesbatchtablehierarchy.js
similarity index 100%
rename from test/unit/3dtilesbatchtablehierarchy.js
rename to packages/Main/test/unit/3dtilesbatchtablehierarchy.js
diff --git a/test/unit/3dtilesbinarypropertyaccessor.js b/packages/Main/test/unit/3dtilesbinarypropertyaccessor.js
similarity index 100%
rename from test/unit/3dtilesbinarypropertyaccessor.js
rename to packages/Main/test/unit/3dtilesbinarypropertyaccessor.js
diff --git a/test/unit/3dtilesfeature.js b/packages/Main/test/unit/3dtilesfeature.js
similarity index 100%
rename from test/unit/3dtilesfeature.js
rename to packages/Main/test/unit/3dtilesfeature.js
diff --git a/test/unit/3dtilesgetchildren.js b/packages/Main/test/unit/3dtilesgetchildren.js
similarity index 100%
rename from test/unit/3dtilesgetchildren.js
rename to packages/Main/test/unit/3dtilesgetchildren.js
diff --git a/test/unit/3dtileslayerprocess.js b/packages/Main/test/unit/3dtileslayerprocess.js
similarity index 98%
rename from test/unit/3dtileslayerprocess.js
rename to packages/Main/test/unit/3dtileslayerprocess.js
index df5d1b583a..dd478672bc 100644
--- a/test/unit/3dtileslayerprocess.js
+++ b/packages/Main/test/unit/3dtileslayerprocess.js
@@ -4,7 +4,7 @@ import C3DTilesLayer from 'Layer/C3DTilesLayer';
import C3DTilesSource from 'Source/C3DTilesSource';
import View from 'Core/View';
import GlobeView from 'Core/Prefab/GlobeView';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import sinon from 'sinon';
import Fetcher from 'Provider/Fetcher';
import Renderer from './bootstrap';
diff --git a/test/unit/3dtileslayerprocessbatchtable.js b/packages/Main/test/unit/3dtileslayerprocessbatchtable.js
similarity index 98%
rename from test/unit/3dtileslayerprocessbatchtable.js
rename to packages/Main/test/unit/3dtileslayerprocessbatchtable.js
index abc074784b..fc132127fd 100644
--- a/test/unit/3dtileslayerprocessbatchtable.js
+++ b/packages/Main/test/unit/3dtileslayerprocessbatchtable.js
@@ -7,7 +7,7 @@ import C3DTExtensions from 'Core/3DTiles/C3DTExtensions';
import { C3DTilesTypes } from 'Core/3DTiles/C3DTilesEnums';
import View from 'Core/View';
import GlobeView from 'Core/Prefab/GlobeView';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import Fetcher from 'Provider/Fetcher';
import sinon from 'sinon';
import Renderer from './bootstrap';
diff --git a/test/unit/3dtileslayerstyle.js b/packages/Main/test/unit/3dtileslayerstyle.js
similarity index 94%
rename from test/unit/3dtileslayerstyle.js
rename to packages/Main/test/unit/3dtileslayerstyle.js
index 4c78899983..327fd14daa 100644
--- a/test/unit/3dtileslayerstyle.js
+++ b/packages/Main/test/unit/3dtileslayerstyle.js
@@ -1,7 +1,6 @@
import assert from 'assert';
-import proj4 from 'proj4';
import * as THREE from 'three';
-import Extent from 'Core/Geographic/Extent';
+import { Extent, CRS } from '@itowns/geographic';
import PlanarView from 'Core/Prefab/PlanarView';
import C3DTBatchTable from 'Core/3DTiles/C3DTBatchTable';
import C3DTilesSource from 'Source/C3DTilesSource';
@@ -48,7 +47,7 @@ describe('3DTilesLayer Style', () => {
.callsFake(() => Promise.resolve(tileset));
// Define crs
- proj4.defs('EPSG:3946', '+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
+ CRS.defs('EPSG:3946', '+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
// Define geographic extent: CRS, min/max X, min/max Y
const extent = new Extent('EPSG:3946',
diff --git a/test/unit/bootstrap.js b/packages/Main/test/unit/bootstrap.js
similarity index 100%
rename from test/unit/bootstrap.js
rename to packages/Main/test/unit/bootstrap.js
diff --git a/test/unit/cache.js b/packages/Main/test/unit/cache.js
similarity index 100%
rename from test/unit/cache.js
rename to packages/Main/test/unit/cache.js
diff --git a/test/unit/camera.js b/packages/Main/test/unit/camera.js
similarity index 97%
rename from test/unit/camera.js
rename to packages/Main/test/unit/camera.js
index a2738ee4fe..ed7c8c5efd 100644
--- a/test/unit/camera.js
+++ b/packages/Main/test/unit/camera.js
@@ -1,6 +1,6 @@
import assert from 'assert';
import Camera, { CAMERA_TYPE } from 'Renderer/Camera';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import { compareWithEpsilon } from './utils';
describe('camera', function () {
diff --git a/test/unit/cameraUtils.js b/packages/Main/test/unit/cameraUtils.js
similarity index 95%
rename from test/unit/cameraUtils.js
rename to packages/Main/test/unit/cameraUtils.js
index a8e57c059c..704edf3d5f 100644
--- a/test/unit/cameraUtils.js
+++ b/packages/Main/test/unit/cameraUtils.js
@@ -1,14 +1,11 @@
import * as THREE from 'three';
import assert from 'assert';
-import Coordinates from 'Core/Geographic/Coordinates';
-import Ellipsoid from 'Core/Math/Ellipsoid';
+import { Coordinates, Ellipsoid, Extent, CRS } from '@itowns/geographic';
import CameraUtils from 'Utils/CameraUtils';
import DEMUtils from 'Utils/DEMUtils';
import Camera, { CAMERA_TYPE } from 'Renderer/Camera';
-import Extent from 'Core/Geographic/Extent';
-import proj4 from 'proj4';
-proj4.defs('EPSG:2154', '+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
+CRS.defs('EPSG:2154', '+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
function equalToFixed(value1, value2, toFixed) {
return value1.toFixed(toFixed) === value2.toFixed(toFixed);
diff --git a/test/unit/dataSourceProvider.js b/packages/Main/test/unit/dataSourceProvider.js
similarity index 99%
rename from test/unit/dataSourceProvider.js
rename to packages/Main/test/unit/dataSourceProvider.js
index 6bbbbb52fa..0a4c93d3a2 100644
--- a/test/unit/dataSourceProvider.js
+++ b/packages/Main/test/unit/dataSourceProvider.js
@@ -3,7 +3,7 @@ import assert from 'assert';
import { updateLayeredMaterialNodeImagery, updateLayeredMaterialNodeElevation } from 'Process/LayeredMaterialNodeProcessing';
import FeatureProcessing from 'Process/FeatureProcessing';
import TileMesh from 'Core/TileMesh';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
import { globalExtentTMS } from 'Core/Tile/TileGrid';
import OBB from 'Renderer/OBB';
import DataSourceProvider from 'Provider/DataSourceProvider';
diff --git a/test/unit/demutils.js b/packages/Main/test/unit/demutils.js
similarity index 97%
rename from test/unit/demutils.js
rename to packages/Main/test/unit/demutils.js
index d48e36187a..78397470e5 100644
--- a/test/unit/demutils.js
+++ b/packages/Main/test/unit/demutils.js
@@ -4,8 +4,7 @@ import WMTSSource from 'Source/WMTSSource';
import Fetcher from 'Provider/Fetcher';
import assert from 'assert';
import GlobeView from 'Core/Prefab/GlobeView';
-import Coordinates from 'Core/Geographic/Coordinates';
-import Extent from 'Core/Geographic/Extent';
+import { Coordinates, Extent } from '@itowns/geographic';
import { updateLayeredMaterialNodeElevation } from 'Process/LayeredMaterialNodeProcessing';
import TileMesh from 'Core/TileMesh';
import OBB from 'Renderer/OBB';
diff --git a/test/unit/entwine.js b/packages/Main/test/unit/entwine.js
similarity index 98%
rename from test/unit/entwine.js
rename to packages/Main/test/unit/entwine.js
index 7a96be6bdd..d2c93a50b6 100644
--- a/test/unit/entwine.js
+++ b/packages/Main/test/unit/entwine.js
@@ -1,7 +1,7 @@
import assert from 'assert';
import View from 'Core/View';
import GlobeView from 'Core/Prefab/GlobeView';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import EntwinePointTileSource from 'Source/EntwinePointTileSource';
import EntwinePointTileLayer from 'Layer/EntwinePointTileLayer';
import EntwinePointTileNode from 'Core/EntwinePointTileNode';
@@ -34,7 +34,7 @@ describe('Entwine Point Tile', function () {
.callsFake(() => Promise.resolve(new ArrayBuffer()));
// currently no test on data fetched...
- LASParser.enableLazPerf('./examples/libs/laz-perf');
+ LASParser.enableLazPerf('../../examples/libs/laz-perf');
source = new EntwinePointTileSource({
url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/pointclouds/entwine',
});
diff --git a/test/unit/feature.js b/packages/Main/test/unit/feature.js
similarity index 98%
rename from test/unit/feature.js
rename to packages/Main/test/unit/feature.js
index 093897b116..cb082bb1da 100644
--- a/test/unit/feature.js
+++ b/packages/Main/test/unit/feature.js
@@ -1,6 +1,6 @@
import assert from 'assert';
import Feature, { FeatureCollection, FEATURE_TYPES } from 'Core/Feature';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
describe('Feature', function () {
const options_A = {
diff --git a/test/unit/feature2mesh.js b/packages/Main/test/unit/feature2mesh.js
similarity index 98%
rename from test/unit/feature2mesh.js
rename to packages/Main/test/unit/feature2mesh.js
index 5fb209a512..ed6dbbb680 100644
--- a/test/unit/feature2mesh.js
+++ b/packages/Main/test/unit/feature2mesh.js
@@ -1,5 +1,5 @@
import * as THREE from 'three';
-import proj4 from 'proj4';
+import { CRS } from '@itowns/geographic';
import assert from 'assert';
import GeoJsonParser from 'Parser/GeoJsonParser';
import Feature2Mesh from 'Converter/Feature2Mesh';
@@ -8,7 +8,7 @@ import geojson from '../data/geojson/holes.geojson';
import geojson2 from '../data/geojson/simple.geojson';
import geojson3 from '../data/geojson/points.geojson';
-proj4.defs('EPSG:3946',
+CRS.defs('EPSG:3946',
'+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
function computeAreaOfMesh(mesh) {
diff --git a/test/unit/featureUtils.js b/packages/Main/test/unit/featureUtils.js
similarity index 98%
rename from test/unit/featureUtils.js
rename to packages/Main/test/unit/featureUtils.js
index df2d11f475..6bfb5cc458 100644
--- a/test/unit/featureUtils.js
+++ b/packages/Main/test/unit/featureUtils.js
@@ -1,7 +1,7 @@
import assert from 'assert';
import GeoJsonParser from 'Parser/GeoJsonParser';
import FeaturesUtils from 'Utils/FeaturesUtils';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import { FEATURE_TYPES } from 'Core/Feature';
import geojson from '../data/geojson/simple.geojson';
diff --git a/test/unit/featuregeometrylayer.js b/packages/Main/test/unit/featuregeometrylayer.js
similarity index 97%
rename from test/unit/featuregeometrylayer.js
rename to packages/Main/test/unit/featuregeometrylayer.js
index 84e23dd8e4..a27360c1cf 100644
--- a/test/unit/featuregeometrylayer.js
+++ b/packages/Main/test/unit/featuregeometrylayer.js
@@ -4,8 +4,7 @@ import GlobeView from 'Core/Prefab/GlobeView';
import FeatureGeometryLayer from 'Layer/FeatureGeometryLayer';
import FileSource from 'Source/FileSource';
import Fetcher from 'Provider/Fetcher';
-import Extent from 'Core/Geographic/Extent';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates, Extent } from '@itowns/geographic';
import OBB from 'Renderer/OBB';
import TileMesh from 'Core/TileMesh';
import sinon from 'sinon';
diff --git a/test/unit/featuregeometrylayererror.js b/packages/Main/test/unit/featuregeometrylayererror.js
similarity index 97%
rename from test/unit/featuregeometrylayererror.js
rename to packages/Main/test/unit/featuregeometrylayererror.js
index 09d696d370..bf6ff18060 100644
--- a/test/unit/featuregeometrylayererror.js
+++ b/packages/Main/test/unit/featuregeometrylayererror.js
@@ -3,8 +3,7 @@ import assert from 'assert';
import GlobeView from 'Core/Prefab/GlobeView';
import FeatureGeometryLayer from 'Layer/FeatureGeometryLayer';
import FileSource from 'Source/FileSource';
-import Extent from 'Core/Geographic/Extent';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Extent, Coordinates } from '@itowns/geographic';
import OBB from 'Renderer/OBB';
import TileMesh from 'Core/TileMesh';
import Renderer from './bootstrap';
diff --git a/test/unit/fetcher.js b/packages/Main/test/unit/fetcher.js
similarity index 100%
rename from test/unit/fetcher.js
rename to packages/Main/test/unit/fetcher.js
diff --git a/test/unit/gdfparser.js b/packages/Main/test/unit/gdfparser.js
similarity index 100%
rename from test/unit/gdfparser.js
rename to packages/Main/test/unit/gdfparser.js
diff --git a/test/unit/geoidgrid.js b/packages/Main/test/unit/geoidgrid.js
similarity index 90%
rename from test/unit/geoidgrid.js
rename to packages/Main/test/unit/geoidgrid.js
index 64a058b0c1..7492d5ffb7 100644
--- a/test/unit/geoidgrid.js
+++ b/packages/Main/test/unit/geoidgrid.js
@@ -1,8 +1,6 @@
import assert from 'assert';
-import Extent from 'Core/Geographic/Extent';
+import { Coordinates, Extent } from '@itowns/geographic';
import GeoidGrid from 'Core/Geographic/GeoidGrid';
-import Coordinates from 'Core/Geographic/Coordinates';
-
describe('GeoidGrid', function () {
let geoidGrid;
diff --git a/test/unit/geoidlayer.js b/packages/Main/test/unit/geoidlayer.js
similarity index 96%
rename from test/unit/geoidlayer.js
rename to packages/Main/test/unit/geoidlayer.js
index 687a8553b5..e704996079 100644
--- a/test/unit/geoidlayer.js
+++ b/packages/Main/test/unit/geoidlayer.js
@@ -4,9 +4,8 @@ import assert from 'assert';
import GeoidLayer from 'Layer/GeoidLayer';
import FileSource from 'Source/FileSource';
import Fetcher from 'Provider/Fetcher';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates, Extent } from '@itowns/geographic';
import GlobeView from 'Core/Prefab/GlobeView';
-import Extent from 'Core/Geographic/Extent';
import OBB from 'Renderer/OBB';
import TileMesh from 'Core/TileMesh';
import sinon from 'sinon';
diff --git a/test/unit/geojson.js b/packages/Main/test/unit/geojson.js
similarity index 97%
rename from test/unit/geojson.js
rename to packages/Main/test/unit/geojson.js
index 2116eebade..9a40508e58 100644
--- a/test/unit/geojson.js
+++ b/packages/Main/test/unit/geojson.js
@@ -1,13 +1,12 @@
-import proj4 from 'proj4';
import assert from 'assert';
import GeoJsonParser from 'Parser/GeoJsonParser';
-import Extent from 'Core/Geographic/Extent';
+import { Extent, CRS } from '@itowns/geographic';
import holes from '../data/geojson/holes.geojson';
import gpx from '../data/geojson/gpx.geojson';
import points from '../data/geojson/points.geojson';
-proj4.defs('EPSG:3946',
+CRS.defs('EPSG:3946',
'+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
function parse(geojson) {
diff --git a/test/unit/geometrylayer.js b/packages/Main/test/unit/geometrylayer.js
similarity index 100%
rename from test/unit/geometrylayer.js
rename to packages/Main/test/unit/geometrylayer.js
diff --git a/test/unit/globecontrol.js b/packages/Main/test/unit/globecontrol.js
similarity index 99%
rename from test/unit/globecontrol.js
rename to packages/Main/test/unit/globecontrol.js
index e9eb805e3a..be59ce6664 100644
--- a/test/unit/globecontrol.js
+++ b/packages/Main/test/unit/globecontrol.js
@@ -1,7 +1,7 @@
import { MOUSE } from 'three';
import assert from 'assert';
import GlobeView from 'Core/Prefab/GlobeView';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import { getLookAtFromMath, getRig } from 'Utils/CameraUtils';
import StateControl from 'Controls/StateControl';
import Renderer from './bootstrap';
diff --git a/test/unit/globeview.js b/packages/Main/test/unit/globeview.js
similarity index 97%
rename from test/unit/globeview.js
rename to packages/Main/test/unit/globeview.js
index 0d5cf8278b..846e48f942 100644
--- a/test/unit/globeview.js
+++ b/packages/Main/test/unit/globeview.js
@@ -2,8 +2,7 @@ import * as THREE from 'three';
import assert from 'assert';
import GlobeView from 'Core/Prefab/GlobeView';
import ObjectRemovalHelper from 'Process/ObjectRemovalHelper';
-import Coordinates from 'Core/Geographic/Coordinates';
-import Extent from 'Core/Geographic/Extent';
+import { Coordinates, Extent } from '@itowns/geographic';
import Renderer from './bootstrap';
import CameraUtils from '../../src/Utils/CameraUtils';
import OBB from '../../src/Renderer/OBB';
diff --git a/test/unit/gtxparser.js b/packages/Main/test/unit/gtxparser.js
similarity index 100%
rename from test/unit/gtxparser.js
rename to packages/Main/test/unit/gtxparser.js
diff --git a/test/unit/igltfloader.js b/packages/Main/test/unit/igltfloader.js
similarity index 100%
rename from test/unit/igltfloader.js
rename to packages/Main/test/unit/igltfloader.js
diff --git a/test/unit/isgparser.js b/packages/Main/test/unit/isgparser.js
similarity index 100%
rename from test/unit/isgparser.js
rename to packages/Main/test/unit/isgparser.js
diff --git a/test/unit/label.js b/packages/Main/test/unit/label.js
similarity index 98%
rename from test/unit/label.js
rename to packages/Main/test/unit/label.js
index b0fb2a4f61..62e3708621 100644
--- a/test/unit/label.js
+++ b/packages/Main/test/unit/label.js
@@ -3,8 +3,7 @@ import * as THREE from 'three';
import Label from 'Core/Label';
import Style from 'Core/Style';
import { FeatureCollection, FEATURE_TYPES } from 'Core/Feature';
-import Coordinates from 'Core/Geographic/Coordinates';
-import Extent from 'Core/Geographic/Extent';
+import { Coordinates, Extent } from '@itowns/geographic';
import LabelLayer from 'Layer/LabelLayer';
import GlobeView from 'Core/Prefab/GlobeView';
import ColorLayer from 'Layer/ColorLayer';
diff --git a/test/unit/lasparser.js b/packages/Main/test/unit/lasparser.js
similarity index 98%
rename from test/unit/lasparser.js
rename to packages/Main/test/unit/lasparser.js
index 4ce2226eb0..e62678a7f1 100644
--- a/test/unit/lasparser.js
+++ b/packages/Main/test/unit/lasparser.js
@@ -21,7 +21,7 @@ describe('LASParser', function () {
describe('unit tests', function () {
const epsilon = 0.1;
- LASParser.enableLazPerf('./examples/libs/laz-perf');
+ LASParser.enableLazPerf('../../examples/libs/laz-perf');
it('parses a las file to a THREE.BufferGeometry', async function () {
if (!lasData) { this.skip(); }
diff --git a/test/unit/layer.js b/packages/Main/test/unit/layer.js
similarity index 100%
rename from test/unit/layer.js
rename to packages/Main/test/unit/layer.js
diff --git a/test/unit/layeredmaterial.js b/packages/Main/test/unit/layeredmaterial.js
similarity index 98%
rename from test/unit/layeredmaterial.js
rename to packages/Main/test/unit/layeredmaterial.js
index 89f171abf0..0dc2003dbb 100644
--- a/test/unit/layeredmaterial.js
+++ b/packages/Main/test/unit/layeredmaterial.js
@@ -3,7 +3,7 @@ import ColorLayer from 'Layer/ColorLayer';
import TMSSource from 'Source/TMSSource';
import { updateLayeredMaterialNodeImagery } from 'Process/LayeredMaterialNodeProcessing';
import GlobeView from 'Core/Prefab/GlobeView';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import TileMesh from 'Core/TileMesh';
import * as THREE from 'three';
import Tile from 'Core/Tile/Tile';
diff --git a/test/unit/layeredmaterialnodeprocessing.js b/packages/Main/test/unit/layeredmaterialnodeprocessing.js
similarity index 99%
rename from test/unit/layeredmaterialnodeprocessing.js
rename to packages/Main/test/unit/layeredmaterialnodeprocessing.js
index 38c7daf92d..21fadedeb0 100644
--- a/test/unit/layeredmaterialnodeprocessing.js
+++ b/packages/Main/test/unit/layeredmaterialnodeprocessing.js
@@ -2,7 +2,7 @@ import * as THREE from 'three';
import assert from 'assert';
import { updateLayeredMaterialNodeImagery } from 'Process/LayeredMaterialNodeProcessing';
import TileMesh from 'Core/TileMesh';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
import OBB from 'Renderer/OBB';
import Layer from 'Layer/Layer';
import Source from 'Source/Source';
diff --git a/test/unit/layerupdatestrategy.js b/packages/Main/test/unit/layerupdatestrategy.js
similarity index 99%
rename from test/unit/layerupdatestrategy.js
rename to packages/Main/test/unit/layerupdatestrategy.js
index dc57ef9b99..cdafd3f66a 100644
--- a/test/unit/layerupdatestrategy.js
+++ b/packages/Main/test/unit/layerupdatestrategy.js
@@ -1,7 +1,7 @@
import * as THREE from 'three';
import assert from 'assert';
import TileMesh from 'Core/TileMesh';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
import OBB from 'Renderer/OBB';
import Layer from 'Layer/Layer';
import Source from 'Source/Source';
diff --git a/test/unit/obb.js b/packages/Main/test/unit/obb.js
similarity index 93%
rename from test/unit/obb.js
rename to packages/Main/test/unit/obb.js
index 706e0929c9..212e0f240f 100644
--- a/test/unit/obb.js
+++ b/packages/Main/test/unit/obb.js
@@ -1,7 +1,6 @@
import * as THREE from 'three';
-import proj4 from 'proj4';
import assert from 'assert';
-import Extent from 'Core/Geographic/Extent';
+import { Extent, CRS } from '@itowns/geographic';
import { PlanarTileBuilder } from 'Core/Prefab/Planar/PlanarTileBuilder';
import { GlobeTileBuilder } from 'Core/Prefab/Globe/GlobeTileBuilder';
import { newTileGeometry } from 'Core/Prefab/TileBuilder';
@@ -45,7 +44,7 @@ describe('OBB', function () {
// Define crs projection that we will use (taken from https://epsg.io/3946, Proj4js section)
-proj4.defs('EPSG:3946', '+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
+CRS.defs('EPSG:3946', '+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
function assertVerticesAreInOBB(builder, extent) {
const params = {
extent,
diff --git a/test/unit/ogc3dtileslayer.js b/packages/Main/test/unit/ogc3dtileslayer.js
similarity index 100%
rename from test/unit/ogc3dtileslayer.js
rename to packages/Main/test/unit/ogc3dtileslayer.js
diff --git a/test/unit/orientedImageCamera.js b/packages/Main/test/unit/orientedImageCamera.js
similarity index 100%
rename from test/unit/orientedImageCamera.js
rename to packages/Main/test/unit/orientedImageCamera.js
diff --git a/test/unit/orientedimagelayer.js b/packages/Main/test/unit/orientedimagelayer.js
similarity index 93%
rename from test/unit/orientedimagelayer.js
rename to packages/Main/test/unit/orientedimagelayer.js
index 27b81656f5..0724a5a56b 100644
--- a/test/unit/orientedimagelayer.js
+++ b/packages/Main/test/unit/orientedimagelayer.js
@@ -1,8 +1,7 @@
-import proj4 from 'proj4';
import assert from 'assert';
import OrientedImageLayer from 'Layer/OrientedImageLayer';
import OrientedImageSource from 'Source/OrientedImageSource';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates, CRS } from '@itowns/geographic';
import GlobeView from 'Core/Prefab/GlobeView';
import sinon from 'sinon';
import Fetcher from 'Provider/Fetcher';
@@ -28,7 +27,7 @@ describe('Oriented Image Layer', function () {
before(function () {
stubFetcherJson = sinon.stub(Fetcher, 'json')
.callsFake(url => Promise.resolve(JSON.parse(resources[url])));
- proj4.defs('EPSG:2154', '+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
+ CRS.defs('EPSG:2154', '+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');
const renderer = new Renderer();
const p = {
diff --git a/test/unit/planarControls.js b/packages/Main/test/unit/planarControls.js
similarity index 99%
rename from test/unit/planarControls.js
rename to packages/Main/test/unit/planarControls.js
index 3d5e7604ca..23c52b74ad 100644
--- a/test/unit/planarControls.js
+++ b/packages/Main/test/unit/planarControls.js
@@ -2,7 +2,7 @@ import assert from 'assert';
import * as THREE from 'three';
import PlanarView from 'Core/Prefab/PlanarView';
import { CAMERA_TYPE } from 'Renderer/Camera';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
import { keys, STATE } from 'Controls/PlanarControls';
import Renderer from './bootstrap';
diff --git a/test/unit/planarView.js b/packages/Main/test/unit/planarView.js
similarity index 92%
rename from test/unit/planarView.js
rename to packages/Main/test/unit/planarView.js
index c079c081a0..daa8c05693 100644
--- a/test/unit/planarView.js
+++ b/packages/Main/test/unit/planarView.js
@@ -1,5 +1,5 @@
import assert from 'assert';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
import PlanarView from 'Core/Prefab/PlanarView';
import Renderer from './bootstrap';
diff --git a/test/unit/pnts_parser.js b/packages/Main/test/unit/pnts_parser.js
similarity index 100%
rename from test/unit/pnts_parser.js
rename to packages/Main/test/unit/pnts_parser.js
diff --git a/test/unit/pointsmaterial.js b/packages/Main/test/unit/pointsmaterial.js
similarity index 100%
rename from test/unit/pointsmaterial.js
rename to packages/Main/test/unit/pointsmaterial.js
diff --git a/test/unit/potree.js b/packages/Main/test/unit/potree.js
similarity index 99%
rename from test/unit/potree.js
rename to packages/Main/test/unit/potree.js
index 2d1f3bee10..993968c117 100644
--- a/test/unit/potree.js
+++ b/packages/Main/test/unit/potree.js
@@ -4,7 +4,7 @@ import PotreeLayer from 'Layer/PotreeLayer';
import PotreeSource from 'Source/PotreeSource';
import View from 'Core/View';
import GlobeView from 'Core/Prefab/GlobeView';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import PotreeNode from 'Core/PotreeNode';
import sinon from 'sinon';
import Fetcher from 'Provider/Fetcher';
diff --git a/test/unit/potree2.js b/packages/Main/test/unit/potree2.js
similarity index 100%
rename from test/unit/potree2.js
rename to packages/Main/test/unit/potree2.js
diff --git a/test/unit/potree2BinParser.js b/packages/Main/test/unit/potree2BinParser.js
similarity index 100%
rename from test/unit/potree2BinParser.js
rename to packages/Main/test/unit/potree2BinParser.js
diff --git a/test/unit/potree2layerparsing.js b/packages/Main/test/unit/potree2layerparsing.js
similarity index 99%
rename from test/unit/potree2layerparsing.js
rename to packages/Main/test/unit/potree2layerparsing.js
index 9f1dc423fc..09e60ec916 100644
--- a/test/unit/potree2layerparsing.js
+++ b/packages/Main/test/unit/potree2layerparsing.js
@@ -1,7 +1,7 @@
import assert from 'assert';
import Potree2Layer from 'Layer/Potree2Layer';
import Potree2Source from 'Source/Potree2Source';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import GlobeView from 'Core/Prefab/GlobeView';
import View from 'Core/View';
import { HttpsProxyAgent } from 'https-proxy-agent';
diff --git a/test/unit/potree2layerprocessing.js b/packages/Main/test/unit/potree2layerprocessing.js
similarity index 100%
rename from test/unit/potree2layerprocessing.js
rename to packages/Main/test/unit/potree2layerprocessing.js
diff --git a/test/unit/potreeBinParser.js b/packages/Main/test/unit/potreeBinParser.js
similarity index 100%
rename from test/unit/potreeBinParser.js
rename to packages/Main/test/unit/potreeBinParser.js
diff --git a/test/unit/potreelayerparsing.js b/packages/Main/test/unit/potreelayerparsing.js
similarity index 99%
rename from test/unit/potreelayerparsing.js
rename to packages/Main/test/unit/potreelayerparsing.js
index 0f1207edb2..ab91c33325 100644
--- a/test/unit/potreelayerparsing.js
+++ b/packages/Main/test/unit/potreelayerparsing.js
@@ -2,7 +2,7 @@ import assert from 'assert';
import { HttpsProxyAgent } from 'https-proxy-agent';
import PotreeLayer from 'Layer/PotreeLayer';
import PotreeSource from 'Source/PotreeSource';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import GlobeView from 'Core/Prefab/GlobeView';
import View from 'Core/View';
import sinon from 'sinon';
diff --git a/test/unit/potreelayerprocessing.js b/packages/Main/test/unit/potreelayerprocessing.js
similarity index 100%
rename from test/unit/potreelayerprocessing.js
rename to packages/Main/test/unit/potreelayerprocessing.js
diff --git a/test/unit/provider_url.js b/packages/Main/test/unit/provider_url.js
similarity index 98%
rename from test/unit/provider_url.js
rename to packages/Main/test/unit/provider_url.js
index 28a714e95f..be74950d42 100644
--- a/test/unit/provider_url.js
+++ b/packages/Main/test/unit/provider_url.js
@@ -1,7 +1,7 @@
/* eslint-disable no-template-curly-in-string */
import assert from 'assert';
import URLBuilder from 'Provider/URLBuilder';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
import Tile from 'Core/Tile/Tile';
describe('URL creations', function () {
diff --git a/test/unit/scheduler.js b/packages/Main/test/unit/scheduler.js
similarity index 100%
rename from test/unit/scheduler.js
rename to packages/Main/test/unit/scheduler.js
diff --git a/test/unit/shaderchunk.js b/packages/Main/test/unit/shaderchunk.js
similarity index 100%
rename from test/unit/shaderchunk.js
rename to packages/Main/test/unit/shaderchunk.js
diff --git a/test/unit/source.js b/packages/Main/test/unit/source.js
similarity index 99%
rename from test/unit/source.js
rename to packages/Main/test/unit/source.js
index 9e9d5a9b22..f9457a54ad 100644
--- a/test/unit/source.js
+++ b/packages/Main/test/unit/source.js
@@ -10,7 +10,7 @@ import FileSource from 'Source/FileSource';
import OrientedImageSource from 'Source/OrientedImageSource';
import C3DTilesSource from 'Source/C3DTilesSource';
import C3DTilesIonSource from 'Source/C3DTilesIonSource';
-import Extent from 'Core/Geographic/Extent';
+import { Extent } from '@itowns/geographic';
import Tile from 'Core/Tile/Tile';
import sinon from 'sinon';
import Fetcher from 'Provider/Fetcher';
diff --git a/test/unit/statecontrol.js b/packages/Main/test/unit/statecontrol.js
similarity index 99%
rename from test/unit/statecontrol.js
rename to packages/Main/test/unit/statecontrol.js
index 2420611388..c3ddab893d 100644
--- a/test/unit/statecontrol.js
+++ b/packages/Main/test/unit/statecontrol.js
@@ -1,6 +1,6 @@
import { MOUSE } from 'three';
import assert from 'assert';
-import Coordinates from 'Core/Geographic/Coordinates';
+import { Coordinates } from '@itowns/geographic';
import GlobeView from 'Core/Prefab/GlobeView';
import Renderer from './bootstrap';
diff --git a/test/unit/style.js b/packages/Main/test/unit/style.js
similarity index 100%
rename from test/unit/style.js
rename to packages/Main/test/unit/style.js
diff --git a/test/unit/threeutils.js b/packages/Main/test/unit/threeutils.js
similarity index 100%
rename from test/unit/threeutils.js
rename to packages/Main/test/unit/threeutils.js
diff --git a/test/unit/tile.js b/packages/Main/test/unit/tile.js
similarity index 100%
rename from test/unit/tile.js
rename to packages/Main/test/unit/tile.js
diff --git a/test/unit/tiledGeometryLayer.js b/packages/Main/test/unit/tiledGeometryLayer.js
similarity index 94%
rename from test/unit/tiledGeometryLayer.js
rename to packages/Main/test/unit/tiledGeometryLayer.js
index e10cf12332..562c74515e 100644
--- a/test/unit/tiledGeometryLayer.js
+++ b/packages/Main/test/unit/tiledGeometryLayer.js
@@ -1,9 +1,8 @@
import assert from 'assert';
-import Extent from 'Core/Geographic/Extent';
+import { Extent, Coordinates } from '@itowns/geographic';
import PlanarView from 'Core/Prefab/PlanarView';
import { CAMERA_TYPE } from 'Renderer/Camera';
import GlobeView from 'Core/Prefab/GlobeView';
-import Coordinates from 'Core/Geographic/Coordinates';
import Renderer from './bootstrap';
diff --git a/test/unit/tilemesh.js b/packages/Main/test/unit/tilemesh.js
similarity index 100%
rename from test/unit/tilemesh.js
rename to packages/Main/test/unit/tilemesh.js
diff --git a/test/unit/utils.js b/packages/Main/test/unit/utils.js
similarity index 100%
rename from test/unit/utils.js
rename to packages/Main/test/unit/utils.js
diff --git a/test/unit/vectortiles.js b/packages/Main/test/unit/vectortiles.js
similarity index 100%
rename from test/unit/vectortiles.js
rename to packages/Main/test/unit/vectortiles.js
diff --git a/test/unit/view.js b/packages/Main/test/unit/view.js
similarity index 100%
rename from test/unit/view.js
rename to packages/Main/test/unit/view.js
diff --git a/test/unit/webxr.js b/packages/Main/test/unit/webxr.js
similarity index 100%
rename from test/unit/webxr.js
rename to packages/Main/test/unit/webxr.js
diff --git a/packages/Main/tsconfig.json b/packages/Main/tsconfig.json
new file mode 100644
index 0000000000..8c6936f80e
--- /dev/null
+++ b/packages/Main/tsconfig.json
@@ -0,0 +1,10 @@
+{
+ "extends": "../../tsconfig.json",
+ "include": [ "src/Main.js" ],
+ "exclude": [ "node_modules", "lib" ],
+ "compilerOptions": {
+ "paths": {
+ "*": [ "src/*" ]
+ },
+ }
+}
diff --git a/packages/Widgets/.babelrc b/packages/Widgets/.babelrc
new file mode 100644
index 0000000000..c4d2b6df97
--- /dev/null
+++ b/packages/Widgets/.babelrc
@@ -0,0 +1,24 @@
+{
+ "presets": [
+ ["@babel/preset-typescript"],
+ ["@babel/preset-env", {
+ "targets": {
+ "browsers": "defaults and supports webgl2"
+ },
+ "modules": false
+ }]
+ ],
+ "plugins": [
+ ["module-resolver", {
+ "cwd": "packagejson",
+ "root": ["./src"],
+ "extensions": [".js", ".ts", ".tsx"]
+ }],
+ ["module-extension-resolver", {
+ "srcExtensions": [".ts", ".js"]
+ }],
+ ["@babel/plugin-transform-runtime", {
+ "regenerator": false
+ }]
+ ]
+}
diff --git a/packages/Widgets/.eslintrc.cjs b/packages/Widgets/.eslintrc.cjs
new file mode 100644
index 0000000000..9e9e3440e3
--- /dev/null
+++ b/packages/Widgets/.eslintrc.cjs
@@ -0,0 +1,7 @@
+
+module.exports = {
+ extends: [
+ '../../.eslintrc.cjs',
+ ],
+};
+
diff --git a/packages/Widgets/README.md b/packages/Widgets/README.md
new file mode 100644
index 0000000000..9bb234ebba
--- /dev/null
+++ b/packages/Widgets/README.md
@@ -0,0 +1,26 @@
+## @itowns/widget (private, for the moment)
+
+Graphic user interface for itowns
+
+## Getting started
+
+For the moment, The widget features are exposed in `itowns` module.
+
+```bash
+npm install --save itowns
+```
+
+```js
+import { Navigation } from 'itowns/widgets';
+
+const viewerDiv = document.getElementById('viewerDiv');
+
+// Create a GlobeView
+const view = new itowns.GlobeView(viewerDiv);
+
+// Add navigation widget
+const navigation = new Navigation(view, {
+ position: 'bottom-right',
+ translate: { y: -40 },
+});
+```
\ No newline at end of file
diff --git a/packages/Widgets/package.json b/packages/Widgets/package.json
new file mode 100644
index 0000000000..694a8554ba
--- /dev/null
+++ b/packages/Widgets/package.json
@@ -0,0 +1,36 @@
+{
+ "private": true,
+ "version": "2.44.2",
+ "description": "Widgets",
+ "type": "module",
+ "main": "lib/Main.js",
+ "exports": {
+ ".": "./lib/Main.js"
+ },
+ "scripts": {
+ "lint": "eslint \"src/**/*.{js,ts,tsx}\"",
+ "copy_transpile": "npx copyfiles -u 1 \"./lib/**/*\" ../Main/lib/Utils/gui/",
+ "transpileOnly": "cross-env BABEL_DISABLE_CACHE=1 babel src --out-dir lib --extensions .js,.ts",
+ "transpile": "npm run transpileOnly && npm run copy_transpile",
+ "watch": "npm run transpileOnly -- --watch",
+ "publish-next": "npm version prerelease --preid next"
+ },
+ "files": [
+ "*.md",
+ "src",
+ "lib"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/iTowns/itowns.git"
+ },
+ "license": "(CECILL-B OR MIT)",
+ "bugs": {
+ "url": "https://github.com/itowns/itowns/issues"
+ },
+ "dependencies": {
+ "@itowns/geographic": "^2.44.2",
+ "itowns": "^2.44.2"
+ },
+ "homepage": "https://itowns.github.io/"
+}
diff --git a/src/Utils/gui/C3DTilesStyle.js b/packages/Widgets/src/C3DTilesStyle.js
similarity index 99%
rename from src/Utils/gui/C3DTilesStyle.js
rename to packages/Widgets/src/C3DTilesStyle.js
index 6fabf4f72a..620f581fb3 100644
--- a/src/Utils/gui/C3DTilesStyle.js
+++ b/packages/Widgets/src/C3DTilesStyle.js
@@ -1,4 +1,4 @@
-import { C3DTILES_LAYER_EVENTS } from 'Layer/C3DTilesLayer';
+import { C3DTILES_LAYER_EVENTS } from 'itowns';
import Widget from './Widget';
const DEFAULT_OPTIONS = {
diff --git a/src/Utils/gui/Main.js b/packages/Widgets/src/Main.js
similarity index 100%
rename from src/Utils/gui/Main.js
rename to packages/Widgets/src/Main.js
diff --git a/src/Utils/gui/Minimap.js b/packages/Widgets/src/Minimap.js
similarity index 97%
rename from src/Utils/gui/Minimap.js
rename to packages/Widgets/src/Minimap.js
index a88c6b3572..461ab94c2d 100644
--- a/src/Utils/gui/Minimap.js
+++ b/packages/Widgets/src/Minimap.js
@@ -1,7 +1,5 @@
-import Coordinates from 'Core/Geographic/Coordinates';
-import { MAIN_LOOP_EVENTS } from 'Core/MainLoop';
-import PlanarView from 'Core/Prefab/PlanarView';
-import { CAMERA_TYPE } from 'Renderer/Camera';
+import { Coordinates } from '@itowns/geographic';
+import { MAIN_LOOP_EVENTS, PlanarView, CAMERA_TYPE } from 'itowns';
import Widget from './Widget';
diff --git a/src/Utils/gui/Navigation.js b/packages/Widgets/src/Navigation.js
similarity index 99%
rename from src/Utils/gui/Navigation.js
rename to packages/Widgets/src/Navigation.js
index 424528234f..3a83ef7770 100644
--- a/src/Utils/gui/Navigation.js
+++ b/packages/Widgets/src/Navigation.js
@@ -1,4 +1,4 @@
-import { VIEW_EVENTS } from 'Core/View';
+import { VIEW_EVENTS } from 'itowns';
import Widget from './Widget';
diff --git a/src/Utils/gui/Scale.js b/packages/Widgets/src/Scale.js
similarity index 96%
rename from src/Utils/gui/Scale.js
rename to packages/Widgets/src/Scale.js
index 37179296b1..8a987576df 100644
--- a/src/Utils/gui/Scale.js
+++ b/packages/Widgets/src/Scale.js
@@ -1,7 +1,4 @@
-import { CONTROL_EVENTS } from 'Controls/GlobeControls';
-import { GLOBE_VIEW_EVENTS } from 'Core/Prefab/GlobeView';
-import { PLANAR_CONTROL_EVENT } from 'Controls/PlanarControls';
-import { VIEW_EVENTS } from 'Core/View';
+import { CONTROL_EVENTS, GLOBE_VIEW_EVENTS, PLANAR_CONTROL_EVENT, VIEW_EVENTS } from 'itowns';
import Widget from './Widget';
diff --git a/src/Utils/gui/Searchbar.js b/packages/Widgets/src/Searchbar.js
similarity index 99%
rename from src/Utils/gui/Searchbar.js
rename to packages/Widgets/src/Searchbar.js
index 391e5cb804..79bc89f870 100644
--- a/src/Utils/gui/Searchbar.js
+++ b/packages/Widgets/src/Searchbar.js
@@ -1,4 +1,4 @@
-import Fetcher from 'Provider/Fetcher';
+import { Fetcher } from 'itowns';
import Widget from './Widget';
diff --git a/src/Utils/gui/Widget.js b/packages/Widgets/src/Widget.js
similarity index 100%
rename from src/Utils/gui/Widget.js
rename to packages/Widgets/src/Widget.js
diff --git a/packages/Widgets/tsconfig.json b/packages/Widgets/tsconfig.json
new file mode 100644
index 0000000000..8c6936f80e
--- /dev/null
+++ b/packages/Widgets/tsconfig.json
@@ -0,0 +1,10 @@
+{
+ "extends": "../../tsconfig.json",
+ "include": [ "src/Main.js" ],
+ "exclude": [ "node_modules", "lib" ],
+ "compilerOptions": {
+ "paths": {
+ "*": [ "src/*" ]
+ },
+ }
+}
diff --git a/tsconfig.json b/tsconfig.json
index 63841f2d26..afff4f5d4f 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,14 +1,9 @@
{
- "include": [ "src/Main.js" ],
- "exclude": [ "node_modules", "lib", "dist" ],
"compilerOptions": {
/* Type Checking */
"strict": true,
/* Modules */
"baseUrl": ".",
- "paths": {
- "*": [ "src/*" ]
- },
"module": "ESNext",
/* Emit */
"declaration": true,
diff --git a/utils/debug/Main.js b/utils/debug/Main.js
deleted file mode 100644
index 5279127956..0000000000
--- a/utils/debug/Main.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export { default as Debug } from './Debug';
-export { default as PointCloudDebug } from './PointCloudDebug';
-export { default as createTileDebugUI } from './TileDebug';
-export { default as create3dTilesDebugUI } from './3dTilesDebug';
-export { default as createOGC3DTilesDebugUI } from './OGC3DTilesDebug';
-export { default as GeometryDebug } from './GeometryDebug';
diff --git a/webpack.config.cjs b/webpack.config.cjs
index d954fb78c0..0b1617e4d2 100644
--- a/webpack.config.cjs
+++ b/webpack.config.cjs
@@ -23,8 +23,10 @@ const babelConf = {
};
const include = [
- path.resolve(__dirname, 'src'),
- path.resolve(__dirname, 'utils'),
+ path.resolve(__dirname, 'packages/Geographic/src'),
+ path.resolve(__dirname, 'packages/Main/src'),
+ path.resolve(__dirname, 'packages/Debug/src'),
+ path.resolve(__dirname, 'packages/Widgets/src'),
];
const exclude = [
@@ -50,25 +52,29 @@ module.exports = () => {
extensionAlias: {
'.js': ['.ts', '.js'],
},
+ alias: {
+ itowns: path.resolve(__dirname, 'packages/Main/src/Main.js'),
+ '@itowns/geographic': path.resolve(__dirname, 'packages/Geographic/src/Main.js'),
+ },
},
entry: {
itowns: [
'core-js',
- './src/MainBundle.js',
+ './packages/Main/src/MainBundle.js',
],
debug: {
- import: './utils/debug/Main.js',
+ import: './packages/Debug/src/Main.js',
dependOn: 'itowns',
},
itowns_widgets: {
- import: './src/Utils/gui/Main.js',
+ import: './packages/Widgets/src/Main.js',
dependOn: 'itowns',
},
itowns_potree2worker: {
- import: './src/Worker/Potree2Worker.js',
+ import: './packages/Main/src/Worker/Potree2Worker.js',
},
itowns_lasworker: {
- import: './src/Worker/LASLoaderWorker.js',
+ import: './packages/Main/src/Worker/LASLoaderWorker.js',
},
},
devtool: 'source-map',