@mapcreator/sdk 1.1.0 → 1.2.0
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/dist/MCMap.d.ts +1 -1
- package/dist/Video.d.ts +2 -1
- package/dist/adornments/connectedLegend.d.ts +4 -1
- package/dist/adornments/heading.d.ts +4 -1
- package/dist/adornments/insetMap.d.ts +5 -2
- package/dist/adornments/manualLegend.d.ts +4 -1
- package/dist/constants/index.d.ts +6 -1
- package/dist/controls/geolocationControls.d.ts +2 -1
- package/dist/controls/webControls.d.ts +2 -1
- package/dist/mapcreator-sdk.js +4088 -3884
- package/dist/mapcreator-sdk.umd.cjs +106 -99
- package/dist/models/marker.d.ts +1 -1
- package/dist/polyfills.d.ts +1 -0
- package/dist/renderAdornments.d.ts +2 -1
- package/dist/report.html +1 -1
- package/dist/types/index.d.ts +7 -0
- package/dist/types/jobObject.d.ts +1 -0
- package/dist/utils/fonts.d.ts +4 -0
- package/dist/utils/geolocation.d.ts +3 -2
- package/dist/utils/helpers.d.ts +2 -0
- package/dist/utils/svgHelpers.d.ts +8 -3
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -23,5 +23,12 @@ export type JobObjectAugmented = JobObject & {
|
|
|
23
23
|
export type LayerInfo = {
|
|
24
24
|
[layerId: string]: {
|
|
25
25
|
visibility: boolean;
|
|
26
|
+
opacity?: number;
|
|
26
27
|
};
|
|
27
28
|
};
|
|
29
|
+
export type Font = {
|
|
30
|
+
name: string;
|
|
31
|
+
family: string;
|
|
32
|
+
weight: string;
|
|
33
|
+
style: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Env, Font } from '../types';
|
|
2
|
+
export declare function loadFont(name: string, vapiUrl: string, accessToken: string): Promise<string | undefined>;
|
|
3
|
+
export declare function loadFontFaces(env: Env, vapiUrl: string, accessToken: string): Promise<Map<string, Font>>;
|
|
4
|
+
export declare function fontKey(family: string, weight: string, style: string): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Map } from '@mapcreator/maplibre-gl';
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
2
|
+
import { SvgCache } from './svgHelpers';
|
|
3
|
+
export declare const loadLocationDot: (map: Map, svgCache: SvgCache) => void;
|
|
4
|
+
export declare const initLayersAndSources: (map: Map, svgCache: SvgCache) => void;
|
|
4
5
|
export declare const addLocationDot: (map: any, lng: number, lat: number) => void;
|
|
5
6
|
export declare const createCircle: (lng: number, lat: number, meters: number) => any;
|
|
6
7
|
export declare const showNotification: () => void;
|
package/dist/utils/helpers.d.ts
CHANGED
|
@@ -21,10 +21,12 @@ export declare function unitConvert(from: Unit, to: Unit, value: number): number
|
|
|
21
21
|
export declare function lerp(value1: number, value2: number, ratio: number): number;
|
|
22
22
|
export declare function unlerp(min: number, max: number, value: number): number;
|
|
23
23
|
export declare function clamp(value: number, min: number, max: number): number;
|
|
24
|
+
export declare function stripQuotes(s: string): string;
|
|
24
25
|
/**
|
|
25
26
|
* Fast hash function for non-cryptographic use
|
|
26
27
|
*/
|
|
27
28
|
export declare function fnv32b(str: string): string;
|
|
28
29
|
export declare function calculateScaleCorrection(jobObject: JobObject, container: HTMLElement): number;
|
|
29
30
|
export declare function almostEqual(a: number, b: number, delta?: number): boolean;
|
|
31
|
+
export declare function isInIframe(): boolean;
|
|
30
32
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JobObjectDataBindings } from '../types/jobObject';
|
|
2
2
|
import { Map as MapLibre } from '@mapcreator/maplibre-gl';
|
|
3
3
|
import { ColorGenerator } from './choropleth';
|
|
4
|
+
import { Font } from '../types';
|
|
4
5
|
export declare function escapeXML(str: string): string;
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function createImage(svgString: string, width: number, height: number): Promise<HTMLImageElement>;
|
|
6
|
+
export declare function createImage(svgString: string, width: number, height: number, fontMap: Map<string, Font>, vapiUrl: string, accessToken: string): Promise<HTMLImageElement>;
|
|
7
7
|
export interface SvgColor {
|
|
8
8
|
name: string;
|
|
9
9
|
color: Color | string | undefined;
|
|
@@ -13,6 +13,8 @@ export interface SvgText {
|
|
|
13
13
|
text: string | undefined;
|
|
14
14
|
isMultiline: boolean;
|
|
15
15
|
}
|
|
16
|
+
export declare function collectUsedFonts(svg: string, fontMap: Map<string, Font>): Font[];
|
|
17
|
+
export declare function injectFonts(svg: string, fonts: Font[], fontBuffers: Array<string | undefined>): string;
|
|
16
18
|
export declare class SvgHelper {
|
|
17
19
|
private _seen;
|
|
18
20
|
private _svg;
|
|
@@ -62,7 +64,10 @@ export declare class SvgHelper {
|
|
|
62
64
|
export declare class SvgCache {
|
|
63
65
|
private map;
|
|
64
66
|
private keyCache;
|
|
65
|
-
|
|
67
|
+
fontMap: Map<string, Font>;
|
|
68
|
+
vapiUrl: string;
|
|
69
|
+
accessToken: string;
|
|
70
|
+
constructor(map: MapLibre, fontMap: Map<string, Font>, vapiUrl: string, accessToken: string);
|
|
66
71
|
getMapLibreImageKey(svg: string, pixelRatio: number): string;
|
|
67
72
|
}
|
|
68
73
|
export declare function measureTextBlock(lines: string[], fontFamily: string, fontSize: number): {
|