@maptiler/sdk 1.2.1 → 2.0.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.
Files changed (63) hide show
  1. package/.eslintrc.cjs +1 -0
  2. package/dist/maptiler-sdk.css +1 -1
  3. package/dist/maptiler-sdk.d.ts +171 -240
  4. package/dist/maptiler-sdk.min.mjs +3 -3
  5. package/dist/maptiler-sdk.mjs +461 -458
  6. package/dist/maptiler-sdk.mjs.map +1 -1
  7. package/package.json +3 -3
  8. package/readme.md +16 -1
  9. package/CHANGELOG.md +0 -168
  10. package/colorramp.md +0 -93
  11. package/dist/maptiler-sdk.umd.js +0 -7702
  12. package/dist/maptiler-sdk.umd.js.map +0 -1
  13. package/dist/maptiler-sdk.umd.min.js +0 -582
  14. package/src/AttributionControl.ts +0 -13
  15. package/src/CanvasSource.ts +0 -13
  16. package/src/FullscreenControl.ts +0 -13
  17. package/src/GeoJSONSource.ts +0 -13
  18. package/src/GeolocateControl.ts +0 -13
  19. package/src/ImageSource.ts +0 -13
  20. package/src/LogoControl.ts +0 -13
  21. package/src/Map.ts +0 -1352
  22. package/src/MaptilerGeolocateControl.ts +0 -207
  23. package/src/MaptilerLogoControl.ts +0 -58
  24. package/src/MaptilerNavigationControl.ts +0 -69
  25. package/src/MaptilerTerrainControl.ts +0 -72
  26. package/src/Marker.ts +0 -13
  27. package/src/Minimap.ts +0 -373
  28. package/src/NavigationControl.ts +0 -13
  29. package/src/Point.ts +0 -334
  30. package/src/Popup.ts +0 -13
  31. package/src/RasterDEMTileSource.ts +0 -13
  32. package/src/RasterTileSource.ts +0 -13
  33. package/src/ScaleControl.ts +0 -13
  34. package/src/Style.ts +0 -13
  35. package/src/TerrainControl.ts +0 -13
  36. package/src/VectorTileSource.ts +0 -13
  37. package/src/VideoSource.ts +0 -13
  38. package/src/colorramp.ts +0 -1216
  39. package/src/config.ts +0 -96
  40. package/src/converters/index.ts +0 -1
  41. package/src/converters/xml.ts +0 -681
  42. package/src/defaults.ts +0 -20
  43. package/src/helpers/index.ts +0 -27
  44. package/src/helpers/stylehelper.ts +0 -395
  45. package/src/helpers/vectorlayerhelpers.ts +0 -1511
  46. package/src/index.ts +0 -201
  47. package/src/language.ts +0 -183
  48. package/src/mapstyle.ts +0 -46
  49. package/src/style/style_template.css +0 -146
  50. package/src/style/svg/v6-compass.svg +0 -12
  51. package/src/style/svg/v6-fullscreen-off.svg +0 -7
  52. package/src/style/svg/v6-fullscreen.svg +0 -7
  53. package/src/style/svg/v6-geolocate-active-error.svg +0 -10
  54. package/src/style/svg/v6-geolocate-active.svg +0 -7
  55. package/src/style/svg/v6-geolocate-background.svg +0 -8
  56. package/src/style/svg/v6-geolocate-disabled.svg +0 -10
  57. package/src/style/svg/v6-geolocate.svg +0 -7
  58. package/src/style/svg/v6-terrain-on.svg +0 -7
  59. package/src/style/svg/v6-terrain.svg +0 -7
  60. package/src/style/svg/v6-zoom-minus.svg +0 -7
  61. package/src/style/svg/v6-zoom-plus.svg +0 -7
  62. package/src/tools.ts +0 -171
  63. 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 };
@@ -1 +0,0 @@
1
- export * from "./xml";