@maptiler/sdk 4.2.0-rc.1 → 5.0.0-rc.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.
- package/README.md +98 -29
- package/dist/ImageViewer/ImageViewer.d.ts +6 -8
- package/dist/ImageViewer/ImageViewerMarker.d.ts +9 -9
- package/dist/Map.d.ts +73 -10
- package/dist/bundler/maplibre-gl-worker.mjs +13839 -0
- package/dist/bundler/next-worker.mjs +16 -0
- package/dist/bundler/next.cjs +42 -0
- package/dist/bundler/next.d.ts +6 -0
- package/dist/bundler/next.mjs +48 -0
- package/dist/bundler/side-effect.d.ts +2 -0
- package/dist/bundler/vite-worker.mjs +11 -0
- package/dist/bundler/webpack-worker.mjs +11 -0
- package/dist/config.d.ts +18 -0
- package/dist/constants/defaults.d.ts +0 -5
- package/dist/controls/MaptilerGeolocateControl.d.ts +1 -1
- package/dist/controls/MaptilerLogoControl.d.ts +1 -2
- package/dist/controls/MaptilerNavigationControl.d.ts +3 -4
- package/dist/controls/Minimap.d.ts +3 -3
- package/dist/eslint.mjs +4 -4
- package/dist/index.d.ts +6 -82
- package/dist/mapstyle.d.ts +4 -3
- package/dist/maptiler-sdk.css +1 -1
- package/dist/maptiler-sdk.mjs +3504 -3436
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/tools.d.ts +6 -7
- package/dist/utils/defaultWorkerUrl.d.ts +17 -0
- package/package.json +21 -4
- package/dist/MLAdapters/AttributionControl.d.ts +0 -5
- package/dist/MLAdapters/BoxZoomHandler.d.ts +0 -7
- package/dist/MLAdapters/CanvasSource.d.ts +0 -5
- package/dist/MLAdapters/CooperativeGesturesHandler.d.ts +0 -5
- package/dist/MLAdapters/FullscreenControl.d.ts +0 -5
- package/dist/MLAdapters/GeoJSONSource.d.ts +0 -5
- package/dist/MLAdapters/GeolocateControl.d.ts +0 -5
- package/dist/MLAdapters/ImageSource.d.ts +0 -5
- package/dist/MLAdapters/KeyboardHandler.d.ts +0 -5
- package/dist/MLAdapters/LogoControl.d.ts +0 -5
- package/dist/MLAdapters/MapMouseEvent.d.ts +0 -5
- package/dist/MLAdapters/MapTouchEvent.d.ts +0 -5
- package/dist/MLAdapters/MapWheelEvent.d.ts +0 -5
- package/dist/MLAdapters/Marker.d.ts +0 -5
- package/dist/MLAdapters/NavigationControl.d.ts +0 -5
- package/dist/MLAdapters/Popup.d.ts +0 -5
- package/dist/MLAdapters/RasterDEMTileSource.d.ts +0 -5
- package/dist/MLAdapters/RasterTileSource.d.ts +0 -5
- package/dist/MLAdapters/ScaleControl.d.ts +0 -5
- package/dist/MLAdapters/ScrollZoomHandler.d.ts +0 -5
- package/dist/MLAdapters/Style.d.ts +0 -5
- package/dist/MLAdapters/TerrainControl.d.ts +0 -5
- package/dist/MLAdapters/TwoFingersTouchPitchHandler.d.ts +0 -5
- package/dist/MLAdapters/VectorTileSource.d.ts +0 -5
- package/dist/MLAdapters/VideoSource.d.ts +0 -5
- package/dist/ml-types.d.ts +0 -638
- package/dist/routing.d.ts +0 -18
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Sets the MapLibre worker URL in a Next.js app, from a client component:
|
|
2
|
+
// "use client";
|
|
3
|
+
// import "@maptiler/sdk/next-worker";
|
|
4
|
+
//
|
|
5
|
+
// The URL is provided at build time by `withMaptilerWorker` (see "@maptiler/sdk/next"),
|
|
6
|
+
// which copies the worker files into `public/` and exposes their URL.
|
|
7
|
+
// Imported from the SDK (not "maplibre-gl") so it always sets the worker URL on the MapLibre instance the SDK uses
|
|
8
|
+
import { setWorkerUrl } from "@maptiler/sdk";
|
|
9
|
+
|
|
10
|
+
const workerUrl = process.env.NEXT_PUBLIC_MAPTILER_WORKER_URL;
|
|
11
|
+
|
|
12
|
+
if (workerUrl) {
|
|
13
|
+
setWorkerUrl(workerUrl);
|
|
14
|
+
} else {
|
|
15
|
+
console.warn('[@maptiler/sdk/next-worker] No worker URL found. Wrap your Next.js config with `withMaptilerWorker` from "@maptiler/sdk/next".');
|
|
16
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// CommonJS version of "@maptiler/sdk/next", for `next.config.js` files using `require`.
|
|
2
|
+
// Keep in sync with next.mjs.
|
|
3
|
+
const { copyFileSync, mkdirSync } = require("node:fs");
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
|
|
6
|
+
const WORKER_FILES = ["maplibre-gl-worker.mjs", "maplibre-gl-shared.mjs"];
|
|
7
|
+
const PUBLIC_SUBDIR = "_maptiler";
|
|
8
|
+
|
|
9
|
+
function copyWorkerFiles() {
|
|
10
|
+
// Resolved from the SDK's own dependencies, so the worker always matches the SDK's MapLibre
|
|
11
|
+
const maplibreDist = path.join(path.dirname(require.resolve("maplibre-gl/package.json")), "dist");
|
|
12
|
+
const destination = path.join(process.cwd(), "public", PUBLIC_SUBDIR);
|
|
13
|
+
|
|
14
|
+
mkdirSync(destination, { recursive: true });
|
|
15
|
+
for (const file of WORKER_FILES) {
|
|
16
|
+
copyFileSync(path.join(maplibreDist, file), path.join(destination, file));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function withWorkerEnv(config) {
|
|
21
|
+
const basePath = config.basePath ?? "";
|
|
22
|
+
return {
|
|
23
|
+
...config,
|
|
24
|
+
env: {
|
|
25
|
+
...config.env,
|
|
26
|
+
NEXT_PUBLIC_MAPTILER_WORKER_URL: `${basePath}/${PUBLIC_SUBDIR}/maplibre-gl-worker.mjs`,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function withMaptilerWorker(nextConfig = {}) {
|
|
32
|
+
copyWorkerFiles();
|
|
33
|
+
|
|
34
|
+
// Next.js also accepts a (possibly async) function returning the config
|
|
35
|
+
if (typeof nextConfig === "function") {
|
|
36
|
+
return async (...args) => withWorkerEnv(await nextConfig(...args));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return withWorkerEnv(nextConfig);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
module.exports = { withMaptilerWorker };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wraps a Next.js config so that the MapLibre worker files are copied into `public/_maptiler/`
|
|
3
|
+
* and their URL is exposed to `@maptiler/sdk/next-worker`.
|
|
4
|
+
* Accepts a config object or a (possibly async) function returning one, as Next.js does.
|
|
5
|
+
*/
|
|
6
|
+
export declare function withMaptilerWorker<TConfig extends object | ((...args: any[]) => any)>(nextConfig?: TConfig): TConfig;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Next.js config wrapper that serves the MapLibre worker files from `public/`:
|
|
2
|
+
// // next.config.mjs
|
|
3
|
+
// import { withMaptilerWorker } from "@maptiler/sdk/next";
|
|
4
|
+
// export default withMaptilerWorker(nextConfig);
|
|
5
|
+
//
|
|
6
|
+
// Next.js (Turbopack and webpack modes) does not emit `maplibre-gl-shared.mjs` next to the worker,
|
|
7
|
+
// so both files are copied into `public/` when the config is loaded (on every `next dev` and `next build`).
|
|
8
|
+
// Pair it with `import "@maptiler/sdk/next-worker"` in the component creating the map.
|
|
9
|
+
import { copyFileSync, mkdirSync } from "node:fs";
|
|
10
|
+
import { createRequire } from "node:module";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
|
|
13
|
+
const WORKER_FILES = ["maplibre-gl-worker.mjs", "maplibre-gl-shared.mjs"];
|
|
14
|
+
const PUBLIC_SUBDIR = "_maptiler";
|
|
15
|
+
|
|
16
|
+
function copyWorkerFiles() {
|
|
17
|
+
// Resolved from the SDK's own dependencies, so the worker always matches the SDK's MapLibre
|
|
18
|
+
const require = createRequire(import.meta.url);
|
|
19
|
+
const maplibreDist = path.join(path.dirname(require.resolve("maplibre-gl/package.json")), "dist");
|
|
20
|
+
const destination = path.join(process.cwd(), "public", PUBLIC_SUBDIR);
|
|
21
|
+
|
|
22
|
+
mkdirSync(destination, { recursive: true });
|
|
23
|
+
for (const file of WORKER_FILES) {
|
|
24
|
+
copyFileSync(path.join(maplibreDist, file), path.join(destination, file));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function withWorkerEnv(config) {
|
|
29
|
+
const basePath = config.basePath ?? "";
|
|
30
|
+
return {
|
|
31
|
+
...config,
|
|
32
|
+
env: {
|
|
33
|
+
...config.env,
|
|
34
|
+
NEXT_PUBLIC_MAPTILER_WORKER_URL: `${basePath}/${PUBLIC_SUBDIR}/maplibre-gl-worker.mjs`,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function withMaptilerWorker(nextConfig = {}) {
|
|
40
|
+
copyWorkerFiles();
|
|
41
|
+
|
|
42
|
+
// Next.js also accepts a (possibly async) function returning the config
|
|
43
|
+
if (typeof nextConfig === "function") {
|
|
44
|
+
return async (...args) => withWorkerEnv(await nextConfig(...args));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return withWorkerEnv(nextConfig);
|
|
48
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Sets the MapLibre worker URL for Vite projects:
|
|
2
|
+
// import "@maptiler/sdk/vite-worker";
|
|
3
|
+
//
|
|
4
|
+
// This file is shipped as is (not bundled by the SDK build) so that the `?worker&url` import
|
|
5
|
+
// is resolved by the consumer's Vite, which bundles the worker and its shared chunk into one file.
|
|
6
|
+
// `maplibre-gl` is resolved from the SDK's own dependencies, so the worker always matches the SDK's MapLibre.
|
|
7
|
+
// Imported from the SDK (not "maplibre-gl") so it always sets the worker URL on the MapLibre instance the SDK uses
|
|
8
|
+
import { setWorkerUrl } from "@maptiler/sdk";
|
|
9
|
+
import workerUrl from "maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url";
|
|
10
|
+
|
|
11
|
+
setWorkerUrl(workerUrl);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Sets the MapLibre worker URL for webpack 5 / rspack projects:
|
|
2
|
+
// import "@maptiler/sdk/webpack-worker";
|
|
3
|
+
//
|
|
4
|
+
// This file is shipped as is (not bundled by the SDK build) so that `new URL(..., import.meta.url)`
|
|
5
|
+
// is resolved by the consumer's webpack, which emits the worker file and replaces the expression with its URL.
|
|
6
|
+
// webpack emits only the file named here, so it points to the self-contained worker built by the SDK
|
|
7
|
+
// (MapLibre's worker + its shared chunk), not to MapLibre's own worker, which imports a sibling file.
|
|
8
|
+
// Imported from the SDK (not "maplibre-gl") so it always sets the worker URL on the MapLibre instance the SDK uses
|
|
9
|
+
import { setWorkerUrl } from "@maptiler/sdk";
|
|
10
|
+
|
|
11
|
+
setWorkerUrl(new URL("./maplibre-gl-worker.mjs", import.meta.url).toString());
|
package/dist/config.d.ts
CHANGED
|
@@ -80,6 +80,24 @@ declare class SdkConfig extends EventEmitter {
|
|
|
80
80
|
* Get the fetch fucntion
|
|
81
81
|
*/
|
|
82
82
|
get fetch(): FetchFunction | null;
|
|
83
|
+
/**
|
|
84
|
+
* Switch between the default `api.maptiler.com` host and the EU-based `api.maptiler.eu` host.
|
|
85
|
+
* Set to `false` to switch back to the default.
|
|
86
|
+
*/
|
|
87
|
+
set useEuEndpoints(value: boolean);
|
|
88
|
+
/**
|
|
89
|
+
* Whether the EU-based `api.maptiler.eu` host is currently in use instead of the default `api.maptiler.com`
|
|
90
|
+
*/
|
|
91
|
+
get useEuEndpoints(): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* The host currently used for the MapTiler API requests (`api.maptiler.com` or `api.maptiler.eu`)
|
|
94
|
+
*/
|
|
95
|
+
get apiHost(): string;
|
|
96
|
+
/**
|
|
97
|
+
* The base URL currently used for the MapTiler API requests
|
|
98
|
+
* (`https://api.maptiler.com/` or `https://api.maptiler.eu/`)
|
|
99
|
+
*/
|
|
100
|
+
get apiURL(): string;
|
|
83
101
|
/**
|
|
84
102
|
* The default number of steps to sample for the experimental flyTo path preloading.
|
|
85
103
|
*/
|
|
@@ -2,14 +2,9 @@
|
|
|
2
2
|
* Some default settings for the SDK
|
|
3
3
|
*/
|
|
4
4
|
declare const defaults: {
|
|
5
|
-
maptilerLogoURL: string;
|
|
6
5
|
maptilerURL: string;
|
|
7
|
-
maptilerApiHost: string;
|
|
8
|
-
telemetryURL: string;
|
|
9
|
-
rtlPluginURL: string;
|
|
10
6
|
primaryLanguage: import('@maptiler/client').LanguageInfo;
|
|
11
7
|
secondaryLanguage: import('@maptiler/client').LanguageInfo;
|
|
12
|
-
terrainSourceURL: string;
|
|
13
8
|
terrainSourceId: string;
|
|
14
9
|
};
|
|
15
10
|
export { defaults };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GeolocateControl } from '
|
|
1
|
+
import { GeolocateControl } from 'maplibre-gl';
|
|
2
2
|
/**
|
|
3
3
|
* The MaptilerGeolocateControl is an extension of the original GeolocateControl
|
|
4
4
|
* with a few changes. In this version, the active mode persists as long as the
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { LogoControlOptions as LogoControlOptionsML } from 'maplibre-gl';
|
|
2
|
-
import { LogoControl } from '../MLAdapters/LogoControl';
|
|
1
|
+
import { LogoControl, LogoControlOptions as LogoControlOptionsML } from 'maplibre-gl';
|
|
3
2
|
import { Map as SDKMap } from '../Map';
|
|
4
3
|
type LogoControlOptions = LogoControlOptionsML & {
|
|
5
4
|
logoURL?: string;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { NavigationControlOptions } from 'maplibre-gl';
|
|
2
|
-
import { NavigationControl } from '../MLAdapters/NavigationControl';
|
|
1
|
+
import { NavigationControl, NavigationControlOptions } from 'maplibre-gl';
|
|
3
2
|
type HTMLButtonElementPlus = HTMLButtonElement & {
|
|
4
|
-
clickFunction: (e?:
|
|
3
|
+
clickFunction: (e?: MouseEvent) => unknown;
|
|
5
4
|
};
|
|
6
5
|
export declare class MaptilerNavigationControl extends NavigationControl {
|
|
7
6
|
constructor(options?: NavigationControlOptions);
|
|
8
7
|
/**
|
|
9
8
|
* Overloading: the button now stores its click callback so that we can later on delete it and replace it
|
|
10
9
|
*/
|
|
11
|
-
_createButton(className: string, fn: (e?:
|
|
10
|
+
_createButton(className: string, fn: (e?: MouseEvent) => unknown): HTMLButtonElementPlus;
|
|
12
11
|
/**
|
|
13
12
|
* Overloading: Limit how flat the compass icon can get
|
|
14
13
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Map as SDKMap, MapOptions } from '../Map';
|
|
2
|
-
import { ControlPosition, CustomLayerInterface, FillLayerSpecification, FilterSpecification, IControl, LayerSpecification, LineLayerSpecification, SourceSpecification, StyleOptions, StyleSetterOptions, StyleSpecification, StyleSwapOptions } from 'maplibre-gl';
|
|
2
|
+
import { ControlPosition, CustomLayerInterface, FillLayerSpecification, FilterSpecification, IControl, LayerSpecification, LineLayerSpecification, SourceSpecification, StyleOptions, StyleSetterOptions, AllPaintProperties, AllLayoutProperties, StyleSpecification, StyleSwapOptions } from 'maplibre-gl';
|
|
3
3
|
import { MapStyleVariant, ReferenceMapStyle } from '@maptiler/client';
|
|
4
4
|
export interface ParentRect {
|
|
5
5
|
lineLayout: LineLayerSpecification["layout"];
|
|
@@ -49,8 +49,8 @@ export default class Minimap implements IControl {
|
|
|
49
49
|
removeLayer(id: string): this;
|
|
50
50
|
setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this;
|
|
51
51
|
setFilter(layerId: string, filter?: FilterSpecification | null, options?: StyleSetterOptions): this;
|
|
52
|
-
setPaintProperty(layerId: string, name:
|
|
53
|
-
setLayoutProperty(layerId: string, name:
|
|
52
|
+
setPaintProperty<K extends keyof AllPaintProperties>(layerId: string, name: K, value: AllPaintProperties[K], options?: StyleSetterOptions): this;
|
|
53
|
+
setLayoutProperty<K extends keyof AllLayoutProperties>(layerId: string, name: K, value: AllLayoutProperties[K], options?: StyleSetterOptions): this;
|
|
54
54
|
setGlyphs(glyphsUrl: string | null, options?: StyleSetterOptions): this;
|
|
55
55
|
onAdd(parentMap: SDKMap): HTMLElement;
|
|
56
56
|
onRemove(): void;
|
package/dist/eslint.mjs
CHANGED
|
@@ -15,7 +15,7 @@ export default tseslint.config(
|
|
|
15
15
|
compat: eslintPluginCompat,
|
|
16
16
|
import: {
|
|
17
17
|
rules: {
|
|
18
|
-
"default-imports
|
|
18
|
+
"no-default-imports": {
|
|
19
19
|
meta: {
|
|
20
20
|
type: "suggestion",
|
|
21
21
|
docs: {},
|
|
@@ -50,7 +50,7 @@ export default tseslint.config(
|
|
|
50
50
|
|
|
51
51
|
if (bannedLocationRegex.test(filePath)) {
|
|
52
52
|
node.specifiers.forEach((specifier) => {
|
|
53
|
-
if (specifier.type
|
|
53
|
+
if (specifier.type === "ImportDefaultSpecifier") {
|
|
54
54
|
context.report({
|
|
55
55
|
// @ts-expect-error `message` seems to work with this...
|
|
56
56
|
message: config.message ?? `Importing from '${bannedImport}' is banned in '${fp}'`,
|
|
@@ -75,12 +75,12 @@ export default tseslint.config(
|
|
|
75
75
|
},
|
|
76
76
|
rules: {
|
|
77
77
|
"compat/compat": "error",
|
|
78
|
-
"import/default-imports
|
|
78
|
+
"import/no-default-imports": [
|
|
79
79
|
"error",
|
|
80
80
|
{
|
|
81
81
|
"maplibre-gl$": {
|
|
82
82
|
locations: ["^(?!.*\.d\.ts$).*\.((ts|js))$"],
|
|
83
|
-
message: `Maplibre-gl
|
|
83
|
+
message: `Maplibre-gl v6+ is ESM-only and has no default export, use \`import * as maplibregl from "maplibre-gl"\` or named imports.`,
|
|
84
84
|
ignoreTypeImports: true,
|
|
85
85
|
},
|
|
86
86
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -1,96 +1,20 @@
|
|
|
1
|
-
import { default as maplibregl } from 'maplibre-gl';
|
|
2
1
|
export type * from 'maplibre-gl';
|
|
3
2
|
/**
|
|
4
3
|
* Get the version of MapTiler SDK, this is declared in the vite config
|
|
5
4
|
* to avoid importing the entire package.json
|
|
6
5
|
*/
|
|
7
6
|
export declare function getVersion(): string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
declare const CanvasSourceMLGL: typeof maplibregl.CanvasSource;
|
|
13
|
-
declare const GeoJSONSourceMLGL: typeof maplibregl.GeoJSONSource;
|
|
14
|
-
declare const ImageSourceMLGL: typeof maplibregl.ImageSource;
|
|
15
|
-
declare const RasterTileSourceMLGL: typeof maplibregl.RasterTileSource;
|
|
16
|
-
declare const RasterDEMTileSourceMLGL: typeof maplibregl.RasterDEMTileSource;
|
|
17
|
-
declare const VectorTileSourceMLGL: typeof maplibregl.VectorTileSource;
|
|
18
|
-
declare const VideoSourceMLGL: typeof maplibregl.VideoSource;
|
|
19
|
-
declare const NavigationControMLGL: typeof maplibregl.NavigationControl;
|
|
20
|
-
declare const GeolocateControlMLGL: typeof maplibregl.GeolocateControl;
|
|
21
|
-
declare const AttributionControlMLGL: typeof maplibregl.AttributionControl;
|
|
22
|
-
declare const LogoControlMLGL: typeof maplibregl.LogoControl;
|
|
23
|
-
declare const ScaleControlMLGL: typeof maplibregl.ScaleControl;
|
|
24
|
-
declare const FullscreenControlMLGL: typeof maplibregl.FullscreenControl;
|
|
25
|
-
declare const TerrainControMLGL: typeof maplibregl.TerrainControl;
|
|
26
|
-
declare const BoxZoomHandlerMLGL: typeof maplibregl.BoxZoomHandler;
|
|
27
|
-
declare const ScrollZoomHandlerMLGL: typeof maplibregl.ScrollZoomHandler;
|
|
28
|
-
declare const CooperativeGesturesHandlerMLGL: typeof maplibregl.CooperativeGesturesHandler;
|
|
29
|
-
declare const KeyboardHandlerMLGL: typeof maplibregl.KeyboardHandler;
|
|
30
|
-
declare const TwoFingersTouchPitchHandlerMLGL: typeof maplibregl.TwoFingersTouchPitchHandler;
|
|
31
|
-
declare const MapWheelEventMLGL: typeof maplibregl.MapWheelEvent;
|
|
32
|
-
declare const MapTouchEventMLGL: typeof maplibregl.MapTouchEvent;
|
|
33
|
-
declare const MapMouseEventMLGL: typeof maplibregl.MapMouseEvent;
|
|
34
|
-
declare const configMLGL: {
|
|
35
|
-
MAX_PARALLEL_IMAGE_REQUESTS: number;
|
|
36
|
-
MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME: number;
|
|
37
|
-
MAX_TILE_CACHE_ZOOM_LEVELS: number;
|
|
38
|
-
REGISTERED_PROTOCOLS: {
|
|
39
|
-
[x: string]: maplibregl.AddProtocolAction;
|
|
40
|
-
};
|
|
41
|
-
WORKER_URL: string;
|
|
42
|
-
};
|
|
43
|
-
declare const getMapLibreVersion: typeof maplibregl.getVersion;
|
|
44
|
-
declare const setRTLTextPlugin: typeof maplibregl.setRTLTextPlugin, getRTLTextPluginStatus: typeof maplibregl.getRTLTextPluginStatus, LngLat: typeof maplibregl.LngLat, LngLatBounds: typeof maplibregl.LngLatBounds, MercatorCoordinate: typeof maplibregl.MercatorCoordinate, Evented: typeof maplibregl.Evented, AJAXError: typeof maplibregl.AJAXError, prewarm: typeof maplibregl.prewarm, clearPrewarmedResources: typeof maplibregl.clearPrewarmedResources, Hash: typeof maplibregl.Hash, Point: typeof maplibregl.Point, EdgeInsets: typeof maplibregl.EdgeInsets, DragRotateHandler: typeof maplibregl.DragRotateHandler, DragPanHandler: typeof maplibregl.DragPanHandler, TwoFingersTouchZoomRotateHandler: typeof maplibregl.TwoFingersTouchZoomRotateHandler, DoubleClickZoomHandler: typeof maplibregl.DoubleClickZoomHandler, TwoFingersTouchZoomHandler: typeof maplibregl.TwoFingersTouchZoomHandler, TwoFingersTouchRotateHandler: typeof maplibregl.TwoFingersTouchRotateHandler, getWorkerCount: typeof maplibregl.getWorkerCount, setWorkerCount: typeof maplibregl.setWorkerCount, getMaxParallelImageRequests: typeof maplibregl.getMaxParallelImageRequests, setMaxParallelImageRequests: typeof maplibregl.setMaxParallelImageRequests, getWorkerUrl: typeof maplibregl.getWorkerUrl, setWorkerUrl: typeof maplibregl.setWorkerUrl, addSourceType: (name: string, SourceType: maplibregl.SourceClass) => Promise<void>, importScriptInWorkers: typeof maplibregl.importScriptInWorkers, addProtocol: typeof maplibregl.addProtocol, removeProtocol: typeof maplibregl.removeProtocol;
|
|
45
|
-
export { setRTLTextPlugin, getRTLTextPluginStatus, LngLat, LngLatBounds, MercatorCoordinate, Evented, AJAXError, prewarm, clearPrewarmedResources, Hash, Point, EdgeInsets, DragRotateHandler, DragPanHandler, TwoFingersTouchZoomRotateHandler, DoubleClickZoomHandler, TwoFingersTouchZoomHandler, TwoFingersTouchRotateHandler, getWorkerCount, setWorkerCount, getMaxParallelImageRequests, setMaxParallelImageRequests, getWorkerUrl, setWorkerUrl, addSourceType, importScriptInWorkers, addProtocol, removeProtocol, getMapLibreVersion, MapMLGL, MarkerMLGL, PopupMLGL, StyleMLGL, CanvasSourceMLGL, GeoJSONSourceMLGL, ImageSourceMLGL, RasterTileSourceMLGL, RasterDEMTileSourceMLGL, VectorTileSourceMLGL, VideoSourceMLGL, NavigationControMLGL, GeolocateControlMLGL, AttributionControlMLGL, LogoControlMLGL, ScaleControlMLGL, FullscreenControlMLGL, TerrainControMLGL, BoxZoomHandlerMLGL, ScrollZoomHandlerMLGL, CooperativeGesturesHandlerMLGL, KeyboardHandlerMLGL, TwoFingersTouchPitchHandlerMLGL, MapWheelEventMLGL, MapTouchEventMLGL, MapMouseEventMLGL, configMLGL, };
|
|
46
|
-
export type LngLat = InstanceType<typeof LngLat>;
|
|
47
|
-
export type LngLatBounds = InstanceType<typeof LngLatBounds>;
|
|
48
|
-
export type MercatorCoordinate = InstanceType<typeof MercatorCoordinate>;
|
|
49
|
-
export type Evented = InstanceType<typeof Evented>;
|
|
50
|
-
export type AJAXError = InstanceType<typeof AJAXError>;
|
|
51
|
-
export type Hash = InstanceType<typeof Hash>;
|
|
52
|
-
export type Point = InstanceType<typeof Point>;
|
|
53
|
-
export type EdgeInsets = InstanceType<typeof EdgeInsets>;
|
|
54
|
-
export type DragRotateHandler = InstanceType<typeof DragRotateHandler>;
|
|
55
|
-
export type DragPanHandler = InstanceType<typeof DragPanHandler>;
|
|
56
|
-
export type TwoFingersTouchZoomRotateHandler = InstanceType<typeof TwoFingersTouchZoomRotateHandler>;
|
|
57
|
-
export type DoubleClickZoomHandler = InstanceType<typeof DoubleClickZoomHandler>;
|
|
58
|
-
export type TwoFingersTouchZoomHandler = InstanceType<typeof TwoFingersTouchZoomHandler>;
|
|
59
|
-
export type TwoFingersTouchRotateHandler = InstanceType<typeof TwoFingersTouchRotateHandler>;
|
|
60
|
-
export { Marker } from './MLAdapters/Marker';
|
|
61
|
-
export { Popup } from './MLAdapters/Popup';
|
|
62
|
-
export { Style } from './MLAdapters/Style';
|
|
63
|
-
export { CanvasSource } from './MLAdapters/CanvasSource';
|
|
64
|
-
export { GeoJSONSource } from './MLAdapters/GeoJSONSource';
|
|
65
|
-
export { ImageSource } from './MLAdapters/ImageSource';
|
|
66
|
-
export { RasterTileSource } from './MLAdapters/RasterTileSource';
|
|
67
|
-
export { RasterDEMTileSource } from './MLAdapters/RasterDEMTileSource';
|
|
68
|
-
export { VectorTileSource } from './MLAdapters/VectorTileSource';
|
|
69
|
-
export { VideoSource } from './MLAdapters/VideoSource';
|
|
70
|
-
export { NavigationControl } from './MLAdapters/NavigationControl';
|
|
71
|
-
export { GeolocateControl } from './MLAdapters/GeolocateControl';
|
|
72
|
-
export { AttributionControl } from './MLAdapters/AttributionControl';
|
|
73
|
-
export { LogoControl } from './MLAdapters/LogoControl';
|
|
74
|
-
export { ScaleControl } from './MLAdapters/ScaleControl';
|
|
75
|
-
export { FullscreenControl } from './MLAdapters/FullscreenControl';
|
|
76
|
-
export { TerrainControl } from './MLAdapters/TerrainControl';
|
|
77
|
-
export { BoxZoomHandler } from './MLAdapters/BoxZoomHandler';
|
|
78
|
-
export { ScrollZoomHandler } from './MLAdapters/ScrollZoomHandler';
|
|
79
|
-
export { CooperativeGesturesHandler } from './MLAdapters/CooperativeGesturesHandler';
|
|
80
|
-
export { KeyboardHandler } from './MLAdapters/KeyboardHandler';
|
|
81
|
-
export { TwoFingersTouchPitchHandler } from './MLAdapters/TwoFingersTouchPitchHandler';
|
|
82
|
-
export { MapWheelEvent } from './MLAdapters/MapWheelEvent';
|
|
83
|
-
export { MapTouchEvent } from './MLAdapters/MapTouchEvent';
|
|
84
|
-
export { MapMouseEvent } from './MLAdapters/MapMouseEvent';
|
|
85
|
-
export * from './ml-types';
|
|
86
|
-
export { Map, GeolocationType, type AttributionControlOptions, type MapOptions, type LoadWithTerrainEvent } from './Map';
|
|
7
|
+
export { setRTLTextPlugin, getRTLTextPluginStatus, LngLat, LngLatBounds, MercatorCoordinate, Evented, AJAXError, clearPrewarmedResources, Hash, Point, EdgeInsets, DragRotateHandler, DragPanHandler, TwoFingersTouchZoomRotateHandler, DoubleClickZoomHandler, TwoFingersTouchZoomHandler, TwoFingersTouchRotateHandler, getWorkerCount, setWorkerCount, getMaxParallelImageRequests, setMaxParallelImageRequests, getWorkerUrl, setWorkerUrl, addSourceType, importScriptInWorkers, addProtocol, removeProtocol, } from 'maplibre-gl';
|
|
8
|
+
export { getVersion as getMapLibreVersion, Map as MapMLGL, Marker as MarkerMLGL, Popup as PopupMLGL, Style as StyleMLGL, CanvasSource as CanvasSourceMLGL, GeoJSONSource as GeoJSONSourceMLGL, ImageSource as ImageSourceMLGL, RasterTileSource as RasterTileSourceMLGL, RasterDEMTileSource as RasterDEMTileSourceMLGL, VectorTileSource as VectorTileSourceMLGL, VideoSource as VideoSourceMLGL, NavigationControl as NavigationControMLGL, GeolocateControl as GeolocateControlMLGL, AttributionControl as AttributionControlMLGL, LogoControl as LogoControlMLGL, ScaleControl as ScaleControlMLGL, FullscreenControl as FullscreenControlMLGL, TerrainControl as TerrainControMLGL, BoxZoomHandler as BoxZoomHandlerMLGL, ScrollZoomHandler as ScrollZoomHandlerMLGL, CooperativeGesturesHandler as CooperativeGesturesHandlerMLGL, KeyboardHandler as KeyboardHandlerMLGL, TwoFingersTouchPitchHandler as TwoFingersTouchPitchHandlerMLGL, MapWheelEvent as MapWheelEventMLGL, MapTouchEvent as MapTouchEventMLGL, MapMouseEvent as MapMouseEventMLGL, config as configMLGL, } from 'maplibre-gl';
|
|
9
|
+
export { Marker, Popup, Style, CanvasSource, GeoJSONSource, ImageSource, RasterTileSource, RasterDEMTileSource, VectorTileSource, VideoSource, NavigationControl, GeolocateControl, AttributionControl, LogoControl, ScaleControl, FullscreenControl, TerrainControl, BoxZoomHandler, ScrollZoomHandler, CooperativeGesturesHandler, KeyboardHandler, TwoFingersTouchPitchHandler, MapWheelEvent, MapTouchEvent, MapMouseEvent, } from 'maplibre-gl';
|
|
10
|
+
export { Map, GeolocationType, type AttributionControlOptions, type MapOptions, type LoadWithTerrainEvent, type MaptilerMapEventType, type MapEventTypeSDK } from './Map';
|
|
87
11
|
export type { CameraPosition, TilePreloadOptions, WithTilePreload, PreloadTilesForBoundsOptions, PreloadTilesForCameraPositionsOptions, PreloadTilesOptions, TilePreloadErrorCallback, TilePreloadProgressCallback, } from './tile-preloading';
|
|
88
12
|
export { type BaseGeocodingOptions, type ByIdGeocodingOptions, type CommonForwardAndReverseGeocodingOptions, type GeocodingOptions, type LanguageGeocodingOptions, type ReverseGeocodingOptions, geocoding, } from './geocoding';
|
|
89
|
-
export { type ExtraRoutingOptions, type RoutingOptions, routing } from './routing';
|
|
90
13
|
export * from './controls';
|
|
91
|
-
export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type CenteredStaticMapOptions, 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 GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, type PixelData, ReferenceMapStyle,
|
|
14
|
+
export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type CenteredStaticMapOptions, 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 GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, type PixelData, ReferenceMapStyle, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, bufferToPixelDataBrowser, circumferenceAtLatitude, coordinates, data, elevation, expandMapStyle, geolocation, getBufferToPixelDataParser, getTileCache, mapStylePresetList, math, misc, staticMaps, styleToStyle, type LanguageInfo, areSameLanguages, toLanguageInfo, isLanguageInfo, getAutoLanguage, getLanguageInfoFromFlag, getLanguageInfoFromCode, getLanguageInfoFromKey, canParsePixelData, } from '@maptiler/client';
|
|
92
15
|
export * from './ImageViewer';
|
|
93
16
|
export { getWebGLSupportError, displayWebGLContextLostWarning } from './tools';
|
|
17
|
+
export { prewarm } from './utils/defaultWorkerUrl';
|
|
94
18
|
export { config, SdkConfig } from './config';
|
|
95
19
|
export * from './language';
|
|
96
20
|
export type { Unit } from './types';
|
package/dist/mapstyle.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { StyleSpecification } from 'maplibre-gl';
|
|
1
2
|
import { ReferenceMapStyle, MapStyleVariant } from '@maptiler/client';
|
|
2
|
-
export declare function styleToStyle(style: string | ReferenceMapStyle | MapStyleVariant |
|
|
3
|
-
style: string |
|
|
3
|
+
export declare function styleToStyle(style: string | ReferenceMapStyle | MapStyleVariant | StyleSpecification | null | undefined): {
|
|
4
|
+
style: string | StyleSpecification;
|
|
4
5
|
requiresUrlMonitoring: boolean;
|
|
5
6
|
isFallback: boolean;
|
|
6
7
|
isJSON?: boolean;
|
|
@@ -12,7 +13,7 @@ export declare function urlToAbsoluteUrl(url: string): string;
|
|
|
12
13
|
type StyleValidationReport = {
|
|
13
14
|
isValidJSON: boolean;
|
|
14
15
|
isValidStyle: boolean;
|
|
15
|
-
styleObject:
|
|
16
|
+
styleObject: StyleSpecification | null;
|
|
16
17
|
};
|
|
17
18
|
export declare function convertStringToStyleSpecification(str: string): StyleValidationReport;
|
|
18
19
|
export {};
|