@maptiler/sdk 3.2.0-rc.1 → 3.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.
Files changed (37) hide show
  1. package/.editorconfig +13 -0
  2. package/.husky/pre-commit +2 -1
  3. package/README.md +12 -5
  4. package/dist/maptiler-sdk.mjs +2117 -2609
  5. package/dist/maptiler-sdk.mjs.map +1 -1
  6. package/dist/src/MLAdapters/ScaleControl.d.ts +0 -3
  7. package/dist/src/Map.d.ts +1 -8
  8. package/dist/src/config.d.ts +1 -1
  9. package/dist/src/{MaptilerGeolocateControl.d.ts → controls/MaptilerGeolocateControl.d.ts} +1 -12
  10. package/dist/src/{MaptilerLogoControl.d.ts → controls/MaptilerLogoControl.d.ts} +2 -6
  11. package/dist/src/controls/MaptilerNavigationControl.d.ts +17 -0
  12. package/dist/src/{MaptilerProjectionControl.d.ts → controls/MaptilerProjectionControl.d.ts} +1 -11
  13. package/dist/src/{MaptilerTerrainControl.d.ts → controls/MaptilerTerrainControl.d.ts} +4 -13
  14. package/dist/src/{Minimap.d.ts → controls/Minimap.d.ts} +1 -1
  15. package/dist/src/controls/index.d.ts +6 -0
  16. package/dist/src/helpers/index.d.ts +3 -13
  17. package/dist/src/helpers/stylehelper.d.ts +1 -1
  18. package/dist/src/helpers/vectorlayerhelpers.d.ts +1 -1
  19. package/dist/src/index.d.ts +8 -12
  20. package/dist/src/tools.d.ts +0 -2
  21. package/dist/src/utils/dom.d.ts +2 -0
  22. package/dist/src/utils/index.d.ts +1 -0
  23. package/dist/vite.config-test.d.ts +2 -0
  24. package/dist/vitest-setup-tests.d.ts +1 -0
  25. package/eslint.config.mjs +1 -0
  26. package/package.json +11 -7
  27. package/tsconfig.json +4 -1
  28. package/vite.config-dev.ts +4 -0
  29. package/vite.config-es.ts +4 -0
  30. package/vite.config-test.ts +7 -0
  31. package/vite.config-umd.ts +4 -0
  32. package/vitest-setup-tests.ts +4 -0
  33. package/dist/src/MaptilerNavigationControl.d.ts +0 -30
  34. package/dist/src/MaptilerScaleControl.d.ts +0 -15
  35. /package/dist/src/{colorramp.d.ts → ColorRamp.d.ts} +0 -0
  36. /package/dist/src/{defaults.d.ts → constants/defaults.d.ts} +0 -0
  37. /package/dist/src/{unit.d.ts → types.d.ts} +0 -0
@@ -1,8 +1,5 @@
1
1
  import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
2
2
  import { Map as SDKMap } from '../Map';
3
- /**
4
- * @deprecated Please use MaptilerScaleControl from '@maptiler/sdk' instead.
5
- */
6
3
  export declare class ScaleControl extends maplibregl.ScaleControl {
7
4
  onAdd(map: SDKMap | MapMLGL): HTMLElement;
8
5
  }
package/dist/src/Map.d.ts CHANGED
@@ -2,7 +2,7 @@ import { default as maplibregl, StyleSpecification, MapOptions as MapOptionsML,
2
2
  import { ReferenceMapStyle, MapStyleVariant } from '@maptiler/client';
3
3
  import { SdkConfig } from './config';
4
4
  import { LanguageInfo } from './language';
5
- import { MinimapOptionsInput } from './Minimap';
5
+ import { MinimapOptionsInput } from './controls/Minimap';
6
6
  import { Telemetry } from './Telemetry';
7
7
  export type LoadWithTerrainEvent = {
8
8
  type: "loadWithTerrain";
@@ -125,12 +125,6 @@ export type MapOptions = Omit<MapOptionsML, "style" | "maplibreLogo"> & {
125
125
  * If not provided, the style takes precedence. If provided, overwrite the style.
126
126
  */
127
127
  projection?: ProjectionTypes;
128
- /**
129
- * Enable or disable all default controls. When false, no default controls will be added.
130
- * Individual controls can still be added manually using addControl().
131
- * @default true
132
- */
133
- defaultControls?: boolean;
134
128
  };
135
129
  /**
136
130
  * The Map class can be instanciated to display a map in a `<div>`
@@ -155,7 +149,6 @@ export declare class Map extends maplibregl.Map {
155
149
  private isStyleLocalized;
156
150
  private languageIsUpdated;
157
151
  constructor(options: MapOptions);
158
- private checkControlsConfiguration;
159
152
  /**
160
153
  * Recreates the map instance with the same options.
161
154
  * Useful for WebGL context loss.
@@ -1,7 +1,7 @@
1
1
  import { default as EventEmitter } from 'events';
2
2
  import { LanguageInfo } from './language';
3
3
  import { FetchFunction } from '@maptiler/client';
4
- import { Unit } from './unit';
4
+ import { Unit } from './types';
5
5
  export declare const MAPTILER_SESSION_ID: string;
6
6
  /**
7
7
  * Configuration class for the SDK
@@ -1,10 +1,4 @@
1
- import { GeolocateControlOptions, Map as MapMLGL } from 'maplibre-gl';
2
- import { GeolocateControl } from './MLAdapters/GeolocateControl';
3
- import { Map as SDKMap } from './Map';
4
- type MaptilerGeolocateControlOptions = GeolocateControlOptions & {
5
- geolocateElement?: HTMLElement;
6
- removeDefaultDOM?: boolean;
7
- };
1
+ import { GeolocateControl } from '../MLAdapters/GeolocateControl';
8
2
  /**
9
3
  * The MaptilerGeolocateControl is an extension of the original GeolocateControl
10
4
  * with a few changes. In this version, the active mode persists as long as the
@@ -13,10 +7,6 @@ type MaptilerGeolocateControlOptions = GeolocateControlOptions & {
13
7
  */
14
8
  export declare class MaptilerGeolocateControl extends GeolocateControl {
15
9
  private lastUpdatedCenter;
16
- private removeDefaultDOM;
17
- private externalGeolocateElement?;
18
- constructor(options?: MaptilerGeolocateControlOptions);
19
- onAdd(map: SDKMap | MapMLGL): HTMLElement;
20
10
  /**
21
11
  * Update the camera location to center on the current position
22
12
  *
@@ -29,4 +19,3 @@ export declare class MaptilerGeolocateControl extends GeolocateControl {
29
19
  _onZoom: () => void;
30
20
  _setErrorState(): void;
31
21
  }
32
- export {};
@@ -1,10 +1,9 @@
1
1
  import { LogoControlOptions as LogoControlOptionsML } from 'maplibre-gl';
2
- import { LogoControl } from './MLAdapters/LogoControl';
3
- import { Map as SDKMap } from './Map';
2
+ import { LogoControl } from '../MLAdapters/LogoControl';
3
+ import { Map as SDKMap } from '../Map';
4
4
  type LogoControlOptions = LogoControlOptionsML & {
5
5
  logoURL?: string;
6
6
  linkURL?: string;
7
- defaultControlsEnabled?: boolean;
8
7
  };
9
8
  /**
10
9
  * This LogoControl extends the MapLibre LogoControl but instead can use any image URL and
@@ -14,10 +13,7 @@ export declare class MaptilerLogoControl extends LogoControl {
14
13
  _compact: boolean;
15
14
  private logoURL;
16
15
  private linkURL;
17
- private defaultControlsEnabled;
18
16
  constructor(options?: LogoControlOptions);
19
17
  onAdd(map: SDKMap): HTMLElement;
20
- _createAnchor(): HTMLAnchorElement;
21
- _externalControlsEnabled(): void;
22
18
  }
23
19
  export {};
@@ -0,0 +1,17 @@
1
+ import { NavigationControlOptions } from 'maplibre-gl';
2
+ import { NavigationControl } from '../MLAdapters/NavigationControl';
3
+ type HTMLButtonElementPlus = HTMLButtonElement & {
4
+ clickFunction: (e?: Event) => unknown;
5
+ };
6
+ export declare class MaptilerNavigationControl extends NavigationControl {
7
+ constructor(options?: NavigationControlOptions);
8
+ /**
9
+ * Overloading: the button now stores its click callback so that we can later on delete it and replace it
10
+ */
11
+ _createButton(className: string, fn: (e?: Event) => unknown): HTMLButtonElementPlus;
12
+ /**
13
+ * Overloading: Limit how flat the compass icon can get
14
+ */
15
+ _rotateCompassArrow: () => void;
16
+ }
17
+ export {};
@@ -1,9 +1,5 @@
1
- import { Map as SDKMap } from './Map';
1
+ import { Map as SDKMap } from '../Map';
2
2
  import { IControl } from 'maplibre-gl';
3
- type MaptilerProjectionControlOptions = {
4
- removeDefaultDOM?: boolean;
5
- projectionElement?: HTMLElement;
6
- };
7
3
  /**
8
4
  * A `MaptilerProjectionControl` control adds a button to switch from Mercator to Globe projection.
9
5
  */
@@ -11,14 +7,8 @@ export declare class MaptilerProjectionControl implements IControl {
11
7
  map: SDKMap;
12
8
  container: HTMLElement;
13
9
  projectionButton: HTMLButtonElement;
14
- private externalProjection?;
15
- private options;
16
- constructor(options?: MaptilerProjectionControlOptions);
17
10
  onAdd(map: SDKMap): HTMLElement;
18
11
  onRemove(): void;
19
- private setupExternalElements;
20
12
  private toggleProjection;
21
- private updateExternalTitle;
22
13
  private updateProjectionIcon;
23
14
  }
24
- export {};
@@ -1,25 +1,16 @@
1
- import { Map as SDKMap } from './Map';
1
+ import { Map as SDKMap } from '../Map';
2
2
  import { IControl } from 'maplibre-gl';
3
3
  /**
4
4
  * A `MaptilerTerrainControl` control adds a button to turn terrain on and off
5
5
  * by triggering the terrain logic that is already deployed in the Map object.
6
6
  */
7
- type MaptilerTerrainControlOptions = {
8
- removeDefaultDOM?: boolean;
9
- terrainElement?: HTMLElement;
10
- };
11
7
  export declare class MaptilerTerrainControl implements IControl {
12
8
  _map: SDKMap;
13
9
  _container: HTMLElement;
14
10
  _terrainButton: HTMLButtonElement;
15
- private externalTerrain?;
16
- private options;
17
- constructor(options?: MaptilerTerrainControlOptions);
11
+ constructor();
18
12
  onAdd(map: SDKMap): HTMLElement;
19
- private setupInternalElements;
20
- private setupExternalElements;
21
13
  onRemove(): void;
22
- _toggleTerrain: () => void;
23
- _updateTerrainIcon: () => void;
14
+ _toggleTerrain(): void;
15
+ _updateTerrainIcon(): void;
24
16
  }
25
- export {};
@@ -1,4 +1,4 @@
1
- import { Map as SDKMap, MapOptions } from './Map';
1
+ import { Map as SDKMap, MapOptions } from '../Map';
2
2
  import { ControlPosition, CustomLayerInterface, FillLayerSpecification, FilterSpecification, IControl, LayerSpecification, LineLayerSpecification, SourceSpecification, StyleOptions, StyleSetterOptions, StyleSpecification, StyleSwapOptions } from 'maplibre-gl';
3
3
  import { MapStyleVariant, ReferenceMapStyle } from '@maptiler/client';
4
4
  export interface ParentRect {
@@ -0,0 +1,6 @@
1
+ export * from './MaptilerGeolocateControl';
2
+ export * from './MaptilerLogoControl';
3
+ export * from './MaptilerTerrainControl';
4
+ export * from './MaptilerNavigationControl';
5
+ export * from './MaptilerProjectionControl';
6
+ export * from './Minimap';
@@ -1,13 +1,3 @@
1
- import { takeScreenshot } from './screenshot';
2
- import { addPolyline, addPolygon, addPoint, addHeatmap } from './vectorlayerhelpers';
3
- export type { ZoomStringValues, ZoomNumberValues, PropertyValues, CommonShapeLayerOptions, PolylineLayerOptions, PolygonLayerOptions, PointLayerOptions, HeatmapLayerOptions, } from './vectorlayerhelpers';
4
- /**
5
- * Helpers are a set of functions to facilitate the creation of sources and layers
6
- */
7
- export declare const helpers: {
8
- addPolyline: typeof addPolyline;
9
- addPolygon: typeof addPolygon;
10
- addPoint: typeof addPoint;
11
- addHeatmap: typeof addHeatmap;
12
- takeScreenshot: typeof takeScreenshot;
13
- };
1
+ export * from './screenshot';
2
+ export * from './vectorlayerhelpers';
3
+ export * from './stylehelper';
@@ -1,5 +1,5 @@
1
1
  import { DataDrivenPropertyValueSpecification, ExpressionSpecification } from 'maplibre-gl';
2
- import { ColorRamp } from '../colorramp';
2
+ import { ColorRamp } from '../ColorRamp';
3
3
  import { DataDrivenStyle, PropertyValues, ZoomNumberValues, ZoomStringValues } from './vectorlayerhelpers';
4
4
  export type ColorPalette = [string, string, string, string];
5
5
  export declare const colorPalettes: Array<ColorPalette>;
@@ -1,6 +1,6 @@
1
1
  import { FeatureCollection } from 'geojson';
2
2
  import { Map as SDKMap } from '../Map';
3
- import { ColorRamp } from '../colorramp';
3
+ import { ColorRamp } from '../ColorRamp';
4
4
  /**
5
5
  * Array of string values that depend on zoom level
6
6
  */
@@ -1,7 +1,8 @@
1
1
  import { default as maplibregl } from 'maplibre-gl';
2
2
  export type * from 'maplibre-gl';
3
3
  /**
4
- * Get the version of MapTiler SDK
4
+ * Get the version of MapTiler SDK, this is declared in the vite config
5
+ * to avoid importing the entire package.json
5
6
  */
6
7
  export declare function getVersion(): string;
7
8
  declare const MapMLGL: typeof maplibregl.Map;
@@ -73,19 +74,14 @@ export { TwoFingersTouchPitchHandler } from './MLAdapters/TwoFingersTouchPitchHa
73
74
  export { MapWheelEvent } from './MLAdapters/MapWheelEvent';
74
75
  export { MapTouchEvent } from './MLAdapters/MapTouchEvent';
75
76
  export { MapMouseEvent } from './MLAdapters/MapMouseEvent';
76
- export { Map, GeolocationType, type MapOptions, type LoadWithTerrainEvent, } from './Map';
77
- export * from './MaptilerGeolocateControl';
78
- export * from './MaptilerLogoControl';
79
- export * from './MaptilerTerrainControl';
80
- export * from './MaptilerNavigationControl';
81
- export * from './MaptilerProjectionControl';
82
- export * from './MaptilerScaleControl';
77
+ export { Map, GeolocationType, type MapOptions, type LoadWithTerrainEvent } from './Map';
78
+ export * from './controls';
83
79
  export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type ByIdGeocodingOptions, type CenteredStaticMapOptions, type CommonForwardAndReverseGeocodingOptions, type CoordinateExport, type CoordinateGrid, type CoordinateId, type CoordinateSearch, type CoordinateSearchResult, type CoordinateTransformResult, type CoordinateTransformation, type Coordinates, type CoordinatesSearchOptions, type CoordinatesTransformOptions, type DefaultTransformation, type ElevationAtOptions, type ElevationBatchOptions, type FeatureHierarchy, type FetchFunction, type GeocodingFeature, type GeocodingOptions, type GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, type LanguageGeocodingOptions, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, type PixelData, ReferenceMapStyle, type ReverseGeocodingOptions, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, bufferToPixelDataBrowser, circumferenceAtLatitude, coordinates, data, elevation, expandMapStyle, geocoding, geolocation, getBufferToPixelDataParser, getTileCache, mapStylePresetList, math, misc, staticMaps, styleToStyle, type LanguageInfo, areSameLanguages, toLanguageInfo, isLanguageInfo, getAutoLanguage, getLanguageInfoFromFlag, getLanguageInfoFromCode, getLanguageInfoFromKey, } from '@maptiler/client';
84
80
  export { getWebGLSupportError, displayWebGLContextLostWarning } from './tools';
85
81
  export { config, SdkConfig } from './config';
86
82
  export * from './language';
87
- export type { Unit } from './unit';
88
- export * from './Minimap';
83
+ export type { Unit } from './types';
89
84
  export * from './converters';
90
- export * from './colorramp';
91
- export * from './helpers';
85
+ export * as helpers from './helpers';
86
+ export * from './ColorRamp';
87
+ export * from './utils';
@@ -2,8 +2,6 @@ import { default as maplibregl, RequestParameters, ResourceType, RequestTransfor
2
2
  import { Map as MapSDK } from './Map';
3
3
  export declare function enableRTL(): void;
4
4
  export declare function bindAll(fns: Array<string>, context: any): void;
5
- export declare function DOMcreate<K extends keyof HTMLElementTagNameMap>(tagName: K, className?: string, container?: HTMLElement): HTMLElementTagNameMap[K];
6
- export declare function DOMRemove(node: HTMLElement): void;
7
5
  /**
8
6
  * This function is meant to be used as transformRequest by any Map instance created.
9
7
  * It adds the session ID as well as the MapTiler Cloud key from the config to all the requests
@@ -0,0 +1,2 @@
1
+ export declare function DOMcreate<K extends keyof HTMLElementTagNameMap>(tagName: K, className?: string, container?: HTMLElement): HTMLElementTagNameMap[K];
2
+ export declare function DOMremove(node: HTMLElement): void;
@@ -0,0 +1 @@
1
+ export * from './dom';
@@ -0,0 +1,2 @@
1
+ declare const _default: import('vite').UserConfig;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
package/eslint.config.mjs CHANGED
@@ -27,6 +27,7 @@ export default tseslint.config(
27
27
  "@typescript-eslint/no-base-to-string": "warn",
28
28
  "@typescript-eslint/no-confusing-void-expression": "warn",
29
29
  "@typescript-eslint/no-explicit-any": "warn",
30
+ "@typescript-eslint/no-empty-function": "warn", // this is to satisfy maplibre-gl custom layer interface
30
31
  "@typescript-eslint/no-floating-promises": "warn",
31
32
  "@typescript-eslint/no-inferrable-types": "off",
32
33
  "@typescript-eslint/no-misused-promises": "warn",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/sdk",
3
- "version": "3.2.0-rc.1",
3
+ "version": "3.2.0",
4
4
  "description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
5
5
  "author": "MapTiler",
6
6
  "module": "dist/maptiler-sdk.mjs",
@@ -38,9 +38,10 @@
38
38
  "prepare": "husky",
39
39
  "doc": "rm -rf docs/* && typedoc --out docs && cp -r images docs/",
40
40
  "ncu": "npx npm-check-updates",
41
- "lint": "npx eslint src",
42
- "lint:fix": "npx eslint src --fix",
43
- "test": "vitest run -c vite.config-test.ts",
41
+ "lint": "eslint src",
42
+ "lint:fix": "eslint src --fix",
43
+ "test:watch": "vitest watch -c vite.config-test.ts --dom",
44
+ "test": "vitest run -c vite.config-test.ts --dom",
44
45
  "install:clean": "rm -rf build/ dist/ node_modules/ && npm ci",
45
46
  "dev": "concurrently \"vite -c vite.config-dev.ts\" \"npm run dev-umd\"",
46
47
  "dev-umd": "npm run build-css && tsc && NODE_ENV=development vite build -w -c vite.config-umd.ts",
@@ -54,14 +55,17 @@
54
55
  "*.ts": "npm run lint:fix"
55
56
  },
56
57
  "devDependencies": {
58
+ "@canvas/image-data": "^1.0.0",
57
59
  "@eslint/js": "^9.21.0",
58
60
  "@types/uuid": "^10.0.0",
59
61
  "@types/xmldom": "^0.1.31",
62
+ "@vitest/web-worker": "^3.0.9",
60
63
  "@xmldom/xmldom": "^0.8.10",
61
64
  "concurrently": "^9.1.2",
62
65
  "eslint": "^9.21.0",
63
66
  "eslint-config-prettier": "^10.0.2",
64
67
  "eslint-plugin-prettier": "^5.2.3",
68
+ "happy-dom": "^17.4.4",
65
69
  "husky": "^8.0.0",
66
70
  "lint-staged": "^15.4.3",
67
71
  "prettier": "3.5.2",
@@ -70,14 +74,14 @@
70
74
  "typescript-eslint": "^8.25.0",
71
75
  "vite": "^6.0.7",
72
76
  "vite-plugin-dts": "^4.5.0",
73
- "vitest": "^2.1.8"
77
+ "vitest": "^3.0.9"
74
78
  },
75
79
  "dependencies": {
76
80
  "@maplibre/maplibre-gl-style-spec": "^23.0.0",
77
- "@maptiler/client": "^2.2.0",
81
+ "@maptiler/client": "^2.3.2",
78
82
  "events": "^3.3.0",
79
83
  "js-base64": "^3.7.7",
80
- "maplibre-gl": "^5.0.1",
84
+ "maplibre-gl": "^5.3.1",
81
85
  "uuid": "^11.0.5"
82
86
  }
83
87
  }
package/tsconfig.json CHANGED
@@ -26,6 +26,9 @@
26
26
  },
27
27
  "include": [
28
28
  "src",
29
- "./eslint.config.mjs"
29
+ "./eslint.config.mjs",
30
+ "test",
31
+ "./vite.config-test.ts",
32
+ "./vitest-setup-tests.ts"
30
33
  ],
31
34
  }
@@ -1,9 +1,13 @@
1
1
  import { defineConfig } from "vitest/config";
2
+ import packagejson from "./package.json";
2
3
 
3
4
  export default defineConfig({
4
5
  server: {
5
6
  port: 3000,
6
7
  },
8
+ define: {
9
+ __MT_SDK_VERSION__: JSON.stringify(packagejson.version),
10
+ },
7
11
  plugins: [
8
12
  {
9
13
  name: 'url-override',
package/vite.config-es.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { resolve } from 'path';
2
2
  import { defineConfig } from 'vite';
3
3
  import dts from 'vite-plugin-dts';
4
+ import packagejson from "./package.json";
4
5
 
5
6
  const isProduction = process.env.NODE_ENV === "production";
6
7
 
@@ -43,6 +44,9 @@ export default defineConfig({
43
44
  globals: {},
44
45
  },
45
46
  },
47
+ },
48
+ define: {
49
+ __MT_SDK_VERSION__: JSON.stringify(packagejson.version),
46
50
  },
47
51
  plugins,
48
52
  })
@@ -1,4 +1,5 @@
1
1
  import { defineConfig } from "vitest/config";
2
+ import packagejson from "./package.json";
2
3
 
3
4
  export default defineConfig({
4
5
  test: {
@@ -6,5 +7,11 @@ export default defineConfig({
6
7
  typecheck: {
7
8
  tsconfig: "./tsconfig.json",
8
9
  },
10
+ // environment: "jsdom",
11
+ globals: true,
12
+ setupFiles: ["@vitest/web-worker", "./vitest-setup-tests.ts"],
13
+ },
14
+ define: {
15
+ __MT_SDK_VERSION__: JSON.stringify(packagejson.version),
9
16
  },
10
17
  });
@@ -1,5 +1,6 @@
1
1
  import { resolve } from 'path';
2
2
  import { defineConfig } from 'vite';
3
+ import packagejson from "./package.json";
3
4
 
4
5
  const isProduction = process.env.NODE_ENV === "production";
5
6
 
@@ -17,5 +18,8 @@ export default defineConfig({
17
18
  formats: ['umd'],
18
19
  }
19
20
  },
21
+ define: {
22
+ __MT_SDK_VERSION__: JSON.stringify(packagejson.version),
23
+ },
20
24
  plugins: [],
21
25
  });
@@ -0,0 +1,4 @@
1
+ import ImageData from "@canvas/image-data";
2
+
3
+ // @ts-expect-error: Global type missing
4
+ global.ImageData = ImageData;
@@ -1,30 +0,0 @@
1
- import { NavigationControl } from './MLAdapters/NavigationControl';
2
- import { Map as MapMLGL, NavigationControlOptions } from 'maplibre-gl';
3
- import { Map as SDKMap } from './Map';
4
- type HTMLButtonElementPlus = HTMLButtonElement & {
5
- clickFunction: (e?: Event) => unknown;
6
- };
7
- type MaptilerNavigationControlOptions = NavigationControlOptions & {
8
- compassElement?: HTMLElement;
9
- zoomInElement?: HTMLElement;
10
- zoomOutElement?: HTMLElement;
11
- removeDefaultDOM?: boolean;
12
- };
13
- export declare class MaptilerNavigationControl extends NavigationControl {
14
- private externalCompass?;
15
- private externalZoomIn?;
16
- private externalZoomOut?;
17
- private removeDefaultDOM?;
18
- constructor(options?: MaptilerNavigationControlOptions);
19
- onAdd(map: SDKMap | MapMLGL): HTMLElement;
20
- private setupExternalElements;
21
- /**
22
- * Overloading: the button now stores its click callback so that we can later on delete it and replace it
23
- */
24
- _createButton(className: string, fn: (e?: Event) => unknown): HTMLButtonElementPlus;
25
- /**
26
- * Overloading: Limit how flat the compass icon can get
27
- */
28
- _rotateCompassArrow: () => void;
29
- }
30
- export {};
@@ -1,15 +0,0 @@
1
- import { default as maplibregl, Map as MapMLGL, ScaleControlOptions } from 'maplibre-gl';
2
- import { Map as SDKMap } from './Map';
3
- type MaptilerScaleControlOptions = ScaleControlOptions & {
4
- removeDefaultDOM?: boolean;
5
- scaleElement?: HTMLElement;
6
- };
7
- export declare class MaptilerScaleControl extends maplibregl.ScaleControl {
8
- private externalScale?;
9
- private removeDefaultDOM?;
10
- constructor(options?: MaptilerScaleControlOptions);
11
- _onMove: () => void;
12
- onAdd(map: SDKMap | MapMLGL): HTMLElement;
13
- onRemove(): void;
14
- }
15
- export {};
File without changes
File without changes