@mapcreator/sdk 1.3.0 → 1.5.1

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.
@@ -1,3 +1,5 @@
1
+ import { JobObjectAnimation } from './jobObject';
2
+ import { LngLat } from './geometry';
1
3
  export interface Keyframe {
2
4
  time: number;
3
5
  center: [number, number];
@@ -11,3 +13,23 @@ export interface Keyframe {
11
13
  transition: 'ease' | 'linear' | 'instant';
12
14
  hideLabels: boolean;
13
15
  }
16
+ type AnimationTarget = JobObjectAnimation['target'];
17
+ export type RegistryAnimation = JobObjectAnimation & {
18
+ target: Extract<AnimationTarget, {
19
+ type: 'model';
20
+ }>;
21
+ };
22
+ export type LayerAnimation = JobObjectAnimation & {
23
+ target: Extract<AnimationTarget, {
24
+ type: 'layer' | 'overlay';
25
+ }>;
26
+ };
27
+ export interface CameraParams {
28
+ center: LngLat;
29
+ zoom: number;
30
+ bearing: number;
31
+ pitch: number;
32
+ fov: number;
33
+ elevation: number;
34
+ }
35
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { JobObject, JobObjectDataBindings, JobObjectStoredValue } from '../types/jobObject';
2
+ import { Map } from '@mapcreator/maplibre-gl';
2
3
  import { LngLat } from '../types/geometry';
3
4
  export declare const numberRe: RegExp;
4
5
  export declare function degToRad(angle: number): number;
@@ -29,4 +30,6 @@ export declare function fnv32b(str: string): string;
29
30
  export declare function calculateScaleCorrection(jobObject: JobObject, container: HTMLElement): number;
30
31
  export declare function almostEqual(a: number, b: number, delta?: number): boolean;
31
32
  export declare function isInIframe(): boolean;
33
+ export declare function pause(ms: number): Promise<void>;
34
+ export declare function visibleOnGlobe(map: Map, lng: number, lat: number): boolean;
32
35
  export {};
@@ -1,4 +1,7 @@
1
1
  import { JobObjectAnimation, JobObjectAnimationType } from '../../types/jobObject';
2
+ import { LayerAnimation, RegistryAnimation } from '../../types/video';
2
3
  export declare function changesOpacity(animation: JobObjectAnimation): boolean;
3
4
  export declare function changesScale(animation: JobObjectAnimation): boolean;
4
5
  export declare function getAnimatedValue(animation: JobObjectAnimation, type: JobObjectAnimationType, time: number): number;
6
+ export declare function isRegistryAnimation(animation: JobObjectAnimation): animation is RegistryAnimation;
7
+ export declare function isLayerAnimation(animation: JobObjectAnimation): animation is LayerAnimation;
@@ -1,13 +1,4 @@
1
- import { LngLat } from '../../types/geometry';
2
- import { Keyframe } from '../../types/video';
3
- interface CameraParams {
4
- center: LngLat;
5
- zoom: number;
6
- bearing: number;
7
- pitch: number;
8
- fov: number;
9
- elevation: number;
10
- }
1
+ import { CameraParams, Keyframe } from '../../types/video';
11
2
  /**
12
3
  * The CameraCurve class represents a camera path of a single video. It takes a video script (array
13
4
  * of keyframes) in its constructor. It then provides a single public method sample(time) that
@@ -36,4 +27,3 @@ export declare class CameraCurve {
36
27
  private getKeyframeIndexByTime;
37
28
  private getKeyframeValue;
38
29
  }
39
- export {};
@@ -1,4 +1,4 @@
1
- import { Keyframe } from '../../types/video';
1
+ import { CameraParams, Keyframe } from '../../types/video';
2
2
  /**
3
3
  * This function fixes the given script so that globe and bearing rotations between keyframes always
4
4
  * happen along the shortest path. This fixes the camera unexpectedly turning the opposite direction
@@ -9,3 +9,4 @@ export declare function unwrapGlobeAndCameraRotation(script: Keyframe[]): Keyfra
9
9
  export declare function zoomToAltitude(zoom: number): number;
10
10
  export declare function getTotalDuration(script: Keyframe[]): number;
11
11
  export declare function getPreciseFramerate(frameRate: number): number;
12
+ export declare function isSameCameraPosition(position1: CameraParams | undefined, position2: CameraParams | undefined): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapcreator/sdk",
3
- "version": "1.3.0",
3
+ "version": "1.5.1",
4
4
  "engines": {
5
5
  "node": "^24.0.0",
6
6
  "npm": "^11.0.0"
@@ -38,6 +38,7 @@
38
38
  "dist"
39
39
  ],
40
40
  "devDependencies": {
41
+ "@changesets/cli": "^2.31.0",
41
42
  "@types/node": "^25.5.0",
42
43
  "@vue/eslint-config-prettier": "^10.2.0",
43
44
  "@vue/eslint-config-typescript": "^13.0.0",
@@ -51,7 +52,7 @@
51
52
  "vite-plugin-dts": "^4.5.4"
52
53
  },
53
54
  "dependencies": {
54
- "@mapcreator/maplibre-gl": "5.7.0-mc.6",
55
+ "@mapcreator/maplibre-gl": "1000.0.1",
55
56
  "@turf/area": "^7.3.4",
56
57
  "@turf/bbox-clip": "^7.3.4",
57
58
  "@turf/intersect": "^7.3.4",