@maptiler/sdk 1.2.1 → 2.0.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/.eslintrc.cjs +1 -0
- package/dist/maptiler-sdk.css +1 -1
- package/dist/maptiler-sdk.d.ts +171 -240
- package/dist/maptiler-sdk.min.mjs +3 -3
- package/dist/maptiler-sdk.mjs +462 -458
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/package.json +3 -3
- package/readme.md +16 -1
- package/CHANGELOG.md +0 -168
- package/colorramp.md +0 -93
- package/dist/maptiler-sdk.umd.js +0 -7702
- package/dist/maptiler-sdk.umd.js.map +0 -1
- package/dist/maptiler-sdk.umd.min.js +0 -582
- package/src/AttributionControl.ts +0 -13
- package/src/CanvasSource.ts +0 -13
- package/src/FullscreenControl.ts +0 -13
- package/src/GeoJSONSource.ts +0 -13
- package/src/GeolocateControl.ts +0 -13
- package/src/ImageSource.ts +0 -13
- package/src/LogoControl.ts +0 -13
- package/src/Map.ts +0 -1352
- package/src/MaptilerGeolocateControl.ts +0 -207
- package/src/MaptilerLogoControl.ts +0 -58
- package/src/MaptilerNavigationControl.ts +0 -69
- package/src/MaptilerTerrainControl.ts +0 -72
- package/src/Marker.ts +0 -13
- package/src/Minimap.ts +0 -373
- package/src/NavigationControl.ts +0 -13
- package/src/Point.ts +0 -334
- package/src/Popup.ts +0 -13
- package/src/RasterDEMTileSource.ts +0 -13
- package/src/RasterTileSource.ts +0 -13
- package/src/ScaleControl.ts +0 -13
- package/src/Style.ts +0 -13
- package/src/TerrainControl.ts +0 -13
- package/src/VectorTileSource.ts +0 -13
- package/src/VideoSource.ts +0 -13
- package/src/colorramp.ts +0 -1216
- package/src/config.ts +0 -96
- package/src/converters/index.ts +0 -1
- package/src/converters/xml.ts +0 -681
- package/src/defaults.ts +0 -20
- package/src/helpers/index.ts +0 -27
- package/src/helpers/stylehelper.ts +0 -395
- package/src/helpers/vectorlayerhelpers.ts +0 -1511
- package/src/index.ts +0 -201
- package/src/language.ts +0 -183
- package/src/mapstyle.ts +0 -46
- package/src/style/style_template.css +0 -146
- package/src/style/svg/v6-compass.svg +0 -12
- package/src/style/svg/v6-fullscreen-off.svg +0 -7
- package/src/style/svg/v6-fullscreen.svg +0 -7
- package/src/style/svg/v6-geolocate-active-error.svg +0 -10
- package/src/style/svg/v6-geolocate-active.svg +0 -7
- package/src/style/svg/v6-geolocate-background.svg +0 -8
- package/src/style/svg/v6-geolocate-disabled.svg +0 -10
- package/src/style/svg/v6-geolocate.svg +0 -7
- package/src/style/svg/v6-terrain-on.svg +0 -7
- package/src/style/svg/v6-terrain.svg +0 -7
- package/src/style/svg/v6-zoom-minus.svg +0 -7
- package/src/style/svg/v6-zoom-plus.svg +0 -7
- package/src/tools.ts +0 -171
- package/src/unit.ts +0 -1
package/src/config.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import EventEmitter from "events";
|
|
2
|
-
import { LanguageString } from "./language";
|
|
3
|
-
import { config as clientConfig, FetchFunction } from "@maptiler/client";
|
|
4
|
-
import { v4 as uuidv4 } from "uuid";
|
|
5
|
-
import { Unit } from "./unit";
|
|
6
|
-
import { defaults } from "./defaults";
|
|
7
|
-
|
|
8
|
-
export const MAPTILER_SESSION_ID = uuidv4();
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Configuration class for the SDK
|
|
12
|
-
*/
|
|
13
|
-
class SdkConfig extends EventEmitter {
|
|
14
|
-
/**
|
|
15
|
-
* The primary language. By default, the language of the web browser is used.
|
|
16
|
-
*/
|
|
17
|
-
primaryLanguage: LanguageString = defaults.primaryLanguage;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The secondary language, to overwrite the default language defined in the map style.
|
|
21
|
-
* This settings is highly dependant on the style compatibility and may not work in most cases.
|
|
22
|
-
*/
|
|
23
|
-
secondaryLanguage?: LanguageString;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Setting on whether of not the SDK runs with a session logic.
|
|
27
|
-
* A "session" is started at the initialization of the SDK and finished when the browser
|
|
28
|
-
* page is being refreshed.
|
|
29
|
-
* When `session` is enabled (default: true), the extra URL param `mtsid` is added to queries
|
|
30
|
-
* on the MapTiler Cloud API. This allows MapTiler to enable "session based billing".
|
|
31
|
-
*/
|
|
32
|
-
session = true;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Unit to be used
|
|
36
|
-
*/
|
|
37
|
-
private _unit: Unit = "metric";
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* MapTiler Cloud API key
|
|
41
|
-
*/
|
|
42
|
-
private _apiKey = "";
|
|
43
|
-
|
|
44
|
-
constructor() {
|
|
45
|
-
super();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Set the unit system
|
|
50
|
-
*/
|
|
51
|
-
set unit(u: Unit) {
|
|
52
|
-
this._unit = u;
|
|
53
|
-
this.emit("unit", u);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Get the unit system
|
|
58
|
-
*/
|
|
59
|
-
get unit(): Unit {
|
|
60
|
-
return this._unit;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Set the MapTiler Cloud API key
|
|
65
|
-
*/
|
|
66
|
-
set apiKey(k: string) {
|
|
67
|
-
this._apiKey = k;
|
|
68
|
-
clientConfig.apiKey = k;
|
|
69
|
-
this.emit("apiKey", k);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Get the MapTiler Cloud API key
|
|
74
|
-
*/
|
|
75
|
-
get apiKey(): string {
|
|
76
|
-
return this._apiKey;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Set a the custom fetch function to replace the default one
|
|
81
|
-
*/
|
|
82
|
-
set fetch(f: FetchFunction) {
|
|
83
|
-
clientConfig.fetch = f;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Get the fetch fucntion
|
|
88
|
-
*/
|
|
89
|
-
get fetch(): FetchFunction | null {
|
|
90
|
-
return clientConfig.fetch;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const config = new SdkConfig();
|
|
95
|
-
|
|
96
|
-
export { config, SdkConfig };
|
package/src/converters/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./xml";
|