Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve dependencies #13

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
lib/
docs/
*.tgz
18 changes: 10 additions & 8 deletions package-lock.json

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

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@
"start": "npm run prepare && python3 -m http.server --directory demo 12345",
"doc": "typedoc --name 'Mapfish Print geoblock' --includeVersion --emit docs --excludeExternals --entryPointStrategy expand ./src"
},
"dependencies": {
"@babel/parser": "^7.23.9"
"optionalDependencies": {
"@geoblocks/print": "0.7"
},
"peerDependencies": {
"ol": "6 || 7 || 8"
},
"devDependencies": {
"@geoblocks/print": "^0.7.4",
"@geoblocks/recast-utils": "^0.1.0",
"@geoblocks/print": "0.7.4",
"@geoblocks/recast-utils": "0.1.0",
"@types/geojson": "7946.0.10",
"@typescript-eslint/eslint-plugin": "6.20.0",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
"gh-pages": "^6.1.1",
"gh-pages": "6.1.1",
"prettier": "3.2.4",
"typedoc": "^0.25.7",
"typedoc": "0.25.7",
"typescript": "5.3.3"
}
}
4 changes: 2 additions & 2 deletions src/MFPEncoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import VectorLayer from 'ol/layer/Vector.js';
import VectorEncoder from './VectorEncoder';
import {toContext} from 'ol/render.js';
import VectorSource from 'ol/source/Vector.js';
import {MVTEncoder} from '@geoblocks/print';
import LayerGroup from 'ol/layer/Group';
import VectorContext from 'ol/render/VectorContext';

Expand Down Expand Up @@ -172,7 +171,7 @@ export default class MFPBaseEncoder {
const layer = layerState.layer;

if (layer instanceof VectorTileLayer) {
return this.encodeMVTLayerState(layerState, printResolution, customizer);
return await this.encodeMVTLayerState(layerState, printResolution, customizer);
}

if (layer instanceof TileLayer) {
Expand Down Expand Up @@ -202,6 +201,7 @@ export default class MFPBaseEncoder {
customizer: BaseCustomizer,
): Promise<MFPLayer[] | MFPLayer | null> {
const layer = layerState.layer as VectorTileLayer;
const {MVTEncoder} = await import('@geoblocks/print');
const encoder = new MVTEncoder();
const printExtent = customizer.printExtent;
const width = getExtentWidth(printExtent) / printResolution;
Expand Down
Loading