jmapcloud-ng-types 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.ts CHANGED
@@ -357,7 +357,11 @@ export interface JAppPrintService {
357
357
  getFileType(): JAPP_PRINT_FILE_TYPES
358
358
  setHiResolution(isHiResolution: boolean): void
359
359
  getHiResolution(): boolean
360
- takeCapture(returnAsScreenCaptureResult?: boolean): Promise<void | JAppPrintCaptureResult>
360
+ takeCapture(
361
+ returnAsScreenCaptureResult?: boolean,
362
+ customRatioWidth?: number,
363
+ customRatioHeight?: number
364
+ ): Promise<void | JAppPrintCaptureResult>
361
365
  }
362
366
 
363
367
  export interface JAppLayerService {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-types",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "JMap Cloud specific version of JMap Cloud NG types and interfaces",
5
5
  "main": "src/app.ts",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "homepage": "https://github.com/k2geospatial/jmapcloud-ng-types#readme",
24
24
  "devDependencies": {
25
25
  "@types/react": "^18.3.2",
26
- "jmapcloud-ng-core-types": "1.0.10",
26
+ "jmapcloud-ng-core-types": "1.0.11",
27
27
  "maplibre-gl": "^4.3.1",
28
28
  "react": "^18.3.1",
29
29
  "typedoc": "^0.25.13"
package/public/app.d.ts CHANGED
@@ -2273,7 +2273,6 @@ declare namespace JMap {
2273
2273
  *
2274
2274
  * Different sizes are available: "letter" | "legal" | "a3" | "a4".
2275
2275
  *
2276
- * @deprecated will be removed in the futur
2277
2276
  * @example
2278
2277
  * ```ts
2279
2278
  * // returns all available paper formats
@@ -2289,7 +2288,6 @@ declare namespace JMap {
2289
2288
  *
2290
2289
  * Technical method, you should not use it.
2291
2290
  *
2292
- * @deprecated will be removed in the futur
2293
2291
  * @throws if format is incorrect
2294
2292
  * @param format the paper format object or a {@link JAPP_PRINT_PAPER_SIZES}
2295
2293
  * @example
@@ -2305,7 +2303,6 @@ declare namespace JMap {
2305
2303
  *
2306
2304
  * Returns the active paper format.
2307
2305
  *
2308
- * @deprecated will be removed in the futur
2309
2306
  * @example
2310
2307
  * ```ts
2311
2308
  * // returns active paper format
@@ -2409,8 +2406,10 @@ declare namespace JMap {
2409
2406
  *
2410
2407
  * Builds a screen capture of the map and launches the download of the file, or returns the screen capture as a data url embeded in a {@link JAppPrintCaptureResult}
2411
2408
  * @param returnAsScreenCaptureResult if true, the method will resolve with a {@link JAppPrintCaptureResult} that you can use to embed the image in an HTML page, otherwise the method will resolve with no result
2409
+ * @param customRatioWidth The custom ratio width. When both customRatioWidth and customRatioHeight are specified, the captured image will be using a custom paper format having the aspect ratio defined by the specified width/height. returnAsScreenCaptureResult must be set to "true" for this parameter to be taken into account
2410
+ * @param customRatioHeight The custom ratio height. returnAsScreenCaptureResult must be set to "true" for this parameters to be taken into account
2412
2411
  *
2413
- * When passing `returnAsScreenCaptureResult = true`, The screen capture process will take into account all Print parameters defined in the Print panel, including page format, scale, North arrow, title, sub-title, etc, but with the following limitations:
2412
+ * When passing `returnAsScreenCaptureResult = true`, the screen capture process will take into account all Print parameters defined in the Print panel, including page format, scale, North arrow, title, sub-title, etc, but with the following limitations:
2414
2413
  *
2415
2414
  * * the image format returned will always be PNG
2416
2415
  * * If you want the Print panel overlays be present in the screen capture, you must programaticaly switch to the Print panel before calling JMap.Application.Print.takeCapture(true), otherwise only the map will be captured
@@ -2422,7 +2421,7 @@ declare namespace JMap {
2422
2421
  * JMap.Application.Print.takeCapture()
2423
2422
  *
2424
2423
  * // add an image to a document with the print result
2425
- * JMap.Application.Print.takeCapture(true).then(
2424
+ * JMap.Application.Print.takeCapture(true, 400, 200).then(
2426
2425
  * printCaptureResult => {
2427
2426
  * const img = document.createElement("img")
2428
2427
  * img.src = printCaptureResult.dataUrl
@@ -2437,7 +2436,11 @@ declare namespace JMap {
2437
2436
  * )
2438
2437
  * ```
2439
2438
  */
2440
- function takeCapture(returnAsScreenCaptureResult?: boolean): Promise<void | JAppPrintCaptureResult>
2439
+ function takeCapture(
2440
+ returnAsScreenCaptureResult?: boolean,
2441
+ customRatioWidth?: number,
2442
+ customRatioHeight?: number
2443
+ ): Promise<void | JAppPrintCaptureResult>
2441
2444
  }
2442
2445
 
2443
2446
  /**
package/public/print.d.ts CHANGED
@@ -10,7 +10,8 @@ declare const enum JAPP_PRINT_PAPER_SIZES {
10
10
  LETTER = "letter",
11
11
  LEGAL = "legal",
12
12
  A3 = "a3",
13
- A4 = "a4"
13
+ A4 = "a4",
14
+ CUSTOM = "custom"
14
15
  }
15
16
 
16
17
  // ALL_APP_PRINT_LEGEND_POSITION in all-enum.ts