-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Use the same interfaces and constant values from maplibre-g… (
#105) * refactor: Use the same interfaces and constant values from maplibre-gl-export * export interfaces from mapbox-gl-export * ci: changed to node v20
- Loading branch information
1 parent
7ba18d0
commit 93722dd
Showing
20 changed files
with
155 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@watergis/mapbox-gl-export": patch | ||
--- | ||
|
||
refactor: import interfaces from maplibre-gl-export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@watergis/maplibre-gl-export": patch | ||
--- | ||
|
||
refactor: export interfaces from maplibre-gl-export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,16 +17,20 @@ jobs: | |
pull-requests: write # to create pull request (changesets/action) | ||
name: Release | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [20] | ||
|
||
steps: | ||
- name: checkout code repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: pnpm/[email protected] | ||
- name: Setup Node.js | ||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.x | ||
node-version: ${{ matrix.node-version }} | ||
cache: pnpm | ||
|
||
- name: install dependencies | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as MapboxExportControl } from './export-control'; | ||
export { Size, PageOrientation, Format, DPI } from './map-generator'; | ||
export { Size, PageOrientation, Format, DPI } from '@watergis/maplibre-gl-export'; | ||
export * from './interfaces'; |
5 changes: 5 additions & 0 deletions
5
packages/mapbox-gl-export/src/lib/interfaces/ControlOptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { type ControlOptions as MaplibreControlOptions } from '@watergis/maplibre-gl-export'; | ||
|
||
export interface ControlOptions extends MaplibreControlOptions { | ||
accessToken?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ControlOptions'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export { default as MaplibreExportControl } from './export-control'; | ||
export { Size, PageOrientation, Format, DPI } from './map-generator'; | ||
export { default as CrosshairManager } from './crosshair-manager'; | ||
export { default as PrintableAreaManager } from './printable-area-manager'; | ||
|
||
export * from './local'; | ||
export * from './interfaces'; |
16 changes: 16 additions & 0 deletions
16
packages/maplibre-gl-export/src/lib/interfaces/ControlOptions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { languages } from '../local'; | ||
import { FormatType } from './Format'; | ||
import { PageOrientationType } from './PageOrientation'; | ||
import { SizeType } from './Size'; | ||
|
||
export interface ControlOptions { | ||
PageSize?: SizeType; | ||
PageOrientation?: PageOrientationType; | ||
Format?: FormatType; | ||
DPI?: number; | ||
Crosshair?: boolean; | ||
PrintableArea?: boolean; | ||
Local?: languages; | ||
AllowedSizes?: ('LETTER' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'B2' | 'B3' | 'B4' | 'B5' | 'B6')[]; | ||
Filename?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const DPI = { | ||
72: 72, | ||
96: 96, | ||
200: 200, | ||
300: 300, | ||
400: 400 | ||
} as const; | ||
export type DPIType = (typeof DPI)[keyof typeof DPI]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export const Format = { | ||
JPEG: 'jpg', | ||
PNG: 'png', | ||
PDF: 'pdf', | ||
SVG: 'svg' | ||
} as const; | ||
export type FormatType = (typeof Format)[keyof typeof Format]; |
5 changes: 5 additions & 0 deletions
5
packages/maplibre-gl-export/src/lib/interfaces/PageOrientation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export const PageOrientation = { | ||
Landscape: 'landscape', | ||
Portrait: 'portrait' | ||
} as const; | ||
export type PageOrientationType = (typeof PageOrientation)[keyof typeof PageOrientation]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const Size = { | ||
// A0, A1, B0, B1 are not working well. | ||
// A0: [1189, 841], | ||
// A1: [841, 594], | ||
LETTER: [279, 216], // 8.5x11 - works | ||
//TABLOID: [432,279] // 11x17 - not working currently prints to 11.68x8.27 in landscape | ||
A2: [594, 420], | ||
A3: [420, 297], | ||
A4: [297, 210], | ||
A5: [210, 148], | ||
A6: [148, 105], | ||
// B0: [1414, 1000], | ||
// B1: [1000, 707], | ||
B2: [707, 500], | ||
B3: [500, 353], | ||
B4: [353, 250], | ||
B5: [250, 176], | ||
B6: [176, 125] | ||
} as const; | ||
export type SizeType = (typeof Size)[keyof typeof Size]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const Unit = { | ||
// don't use inch unit. because page size setting is using mm unit. | ||
in: 'in', | ||
mm: 'mm' | ||
} as const; | ||
export type UnitType = (typeof Unit)[keyof typeof Unit]; |
Oops, something went wrong.