@maptiler/sdk 2.4.2 → 2.5.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.
@@ -18,4 +18,5 @@ export declare class MaptilerGeolocateControl extends GeolocateControl {
18
18
  _finishSetupUI: (supported: boolean) => void;
19
19
  _updateCircleRadius(): void;
20
20
  _onZoom: () => void;
21
+ _setErrorState(): void;
21
22
  }
@@ -1,80 +1,75 @@
1
1
  import { LanguageInfo } from '@maptiler/client';
2
2
 
3
3
  declare const Language: {
4
- readonly AUTO: LanguageInfo;
5
- readonly LATIN: LanguageInfo;
6
- readonly NON_LATIN: LanguageInfo;
7
- readonly LOCAL: LanguageInfo;
4
+ readonly ALBANIAN: LanguageInfo;
8
5
  readonly AMHARIC: LanguageInfo;
9
6
  readonly ARABIC: LanguageInfo;
7
+ readonly ARMENIAN: LanguageInfo;
10
8
  readonly AZERBAIJANI: LanguageInfo;
9
+ readonly BASQUE: LanguageInfo;
11
10
  readonly BELARUSIAN: LanguageInfo;
12
- readonly BULGARIAN: LanguageInfo;
13
11
  readonly BENGALI: LanguageInfo;
14
- readonly BRETON: LanguageInfo;
15
12
  readonly BOSNIAN: LanguageInfo;
13
+ readonly BRETON: LanguageInfo;
14
+ readonly BULGARIAN: LanguageInfo;
16
15
  readonly CATALAN: LanguageInfo;
17
16
  readonly CHINESE: LanguageInfo;
18
17
  readonly TRADITIONAL_CHINESE: LanguageInfo;
19
18
  readonly SIMPLIFIED_CHINESE: LanguageInfo;
20
19
  readonly CORSICAN: LanguageInfo;
20
+ readonly CROATIAN: LanguageInfo;
21
21
  readonly CZECH: LanguageInfo;
22
- readonly WELSH: LanguageInfo;
23
22
  readonly DANISH: LanguageInfo;
23
+ readonly DUTCH: LanguageInfo;
24
24
  readonly GERMAN: LanguageInfo;
25
25
  readonly GREEK: LanguageInfo;
26
26
  readonly ENGLISH: LanguageInfo;
27
27
  readonly ESPERANTO: LanguageInfo;
28
- readonly SPANISH: LanguageInfo;
29
28
  readonly ESTONIAN: LanguageInfo;
30
- readonly BASQUE: LanguageInfo;
31
29
  readonly FINNISH: LanguageInfo;
32
30
  readonly FRENCH: LanguageInfo;
33
31
  readonly FRISIAN: LanguageInfo;
34
- readonly IRISH: LanguageInfo;
35
- readonly SCOTTISH_GAELIC: LanguageInfo;
32
+ readonly GEORGIAN: LanguageInfo;
36
33
  readonly HEBREW: LanguageInfo;
37
34
  readonly HINDI: LanguageInfo;
38
- readonly CROATIAN: LanguageInfo;
39
35
  readonly HUNGARIAN: LanguageInfo;
40
- readonly ARMENIAN: LanguageInfo;
41
- readonly INDONESIAN: LanguageInfo;
42
36
  readonly ICELANDIC: LanguageInfo;
37
+ readonly INDONESIAN: LanguageInfo;
38
+ readonly IRISH: LanguageInfo;
43
39
  readonly ITALIAN: LanguageInfo;
44
40
  readonly JAPANESE: LanguageInfo;
45
41
  readonly JAPANESE_HIRAGANA: LanguageInfo;
46
42
  readonly JAPANESE_2018: LanguageInfo;
47
43
  readonly JAPANESE_KANA: LanguageInfo;
48
44
  readonly JAPANESE_LATIN: LanguageInfo;
49
- readonly GEORGIAN: LanguageInfo;
50
- readonly KAZAKH: LanguageInfo;
51
45
  readonly KANNADA: LanguageInfo;
46
+ readonly KAZAKH: LanguageInfo;
52
47
  readonly KOREAN: LanguageInfo;
53
48
  readonly KOREAN_LATIN: LanguageInfo;
54
49
  readonly KURDISH: LanguageInfo;
55
50
  readonly CLASSICAL_LATIN: LanguageInfo;
56
- readonly LUXEMBOURGISH: LanguageInfo;
57
- readonly LITHUANIAN: LanguageInfo;
58
51
  readonly LATVIAN: LanguageInfo;
52
+ readonly LITHUANIAN: LanguageInfo;
53
+ readonly LUXEMBOURGISH: LanguageInfo;
59
54
  readonly MACEDONIAN: LanguageInfo;
60
55
  readonly MALAYALAM: LanguageInfo;
61
56
  readonly MALTESE: LanguageInfo;
62
- readonly DUTCH: LanguageInfo;
63
57
  readonly NORWEGIAN: LanguageInfo;
64
58
  readonly OCCITAN: LanguageInfo;
65
- readonly POLISH: LanguageInfo;
66
59
  readonly PERSIAN: LanguageInfo;
60
+ readonly POLISH: LanguageInfo;
61
+ readonly PORTUGUESE: LanguageInfo;
67
62
  readonly PUNJABI: LanguageInfo;
68
63
  readonly WESTERN_PUNJABI: LanguageInfo;
69
- readonly PORTUGUESE: LanguageInfo;
70
- readonly ROMANSH: LanguageInfo;
71
64
  readonly ROMANIAN: LanguageInfo;
65
+ readonly ROMANSH: LanguageInfo;
72
66
  readonly RUSSIAN: LanguageInfo;
73
- readonly SLOVAK: LanguageInfo;
74
- readonly SLOVENE: LanguageInfo;
75
- readonly ALBANIAN: LanguageInfo;
76
67
  readonly SERBIAN_CYRILLIC: LanguageInfo;
77
68
  readonly SERBIAN_LATIN: LanguageInfo;
69
+ readonly SCOTTISH_GAELIC: LanguageInfo;
70
+ readonly SLOVAK: LanguageInfo;
71
+ readonly SLOVENE: LanguageInfo;
72
+ readonly SPANISH: LanguageInfo;
78
73
  readonly SWEDISH: LanguageInfo;
79
74
  readonly TAMIL: LanguageInfo;
80
75
  readonly TELUGU: LanguageInfo;
@@ -82,6 +77,11 @@ declare const Language: {
82
77
  readonly TURKISH: LanguageInfo;
83
78
  readonly UKRAINIAN: LanguageInfo;
84
79
  readonly VIETNAMESE: LanguageInfo;
80
+ readonly WELSH: LanguageInfo;
81
+ readonly AUTO: LanguageInfo;
82
+ readonly LATIN: LanguageInfo;
83
+ readonly NON_LATIN: LanguageInfo;
84
+ readonly LOCAL: LanguageInfo;
85
85
  /**
86
86
  * Language mode to display labels in both the local language and the language of the visitor's device, concatenated.
87
87
  * Note that if those two languages are the same, labels won't be duplicated.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/sdk",
3
- "version": "2.4.2",
3
+ "version": "2.5.1",
4
4
  "description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
5
5
  "module": "dist/maptiler-sdk.mjs",
6
6
  "types": "dist/maptiler-sdk.d.ts",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "dependencies": {
64
64
  "@maplibre/maplibre-gl-style-spec": "^20.3.1",
65
- "@maptiler/client": "^2.0.0",
65
+ "@maptiler/client": "^2.2.0",
66
66
  "events": "^3.3.0",
67
67
  "js-base64": "^3.7.4",
68
68
  "maplibre-gl": "4.7.1",
package/readme.md CHANGED
@@ -987,7 +987,40 @@ Turning off *zoom compensation* allows for more accurate adjustments to the visu
987
987
 
988
988
  All the other options are documented on [our reference page](https://docs.maptiler.com/sdk-js/api/helpers/#heatmap) and more examples are available [here](https://docs.maptiler.com/sdk-js/examples/?q=heatmap+helper).
989
989
 
990
- # Other helper
990
+ # Other helpers
991
+ ## Convert GPX and KML to GeoJSON
992
+ In the [Polyline helper section](#polyline-layer-helper) above, we have seen that one can feed the helper directly with a path to a GPX or KML file, that is then converted under the hood client-side into a GeoJSON `FeatureCollection` object. This conversion feature is also exposed and can be used as such:
993
+
994
+ ```ts
995
+ import { gpx } from "@maptiler/sdk";
996
+
997
+ // ... assuming inside an async function
998
+
999
+ // Fetching the GPX file as a string:
1000
+ const gpxFilePath = "some_gps_trace.gpx";
1001
+ const gpxResponse = await fetch(gpxFilePath);
1002
+ const gpxStr = await res.text();
1003
+
1004
+ // Converting the GPX payload into a GeoJSON FeatureCollection:
1005
+ const features = maptilersdk.gpx(gpxStr);
1006
+ ```
1007
+
1008
+ And for KML files:
1009
+ ```ts
1010
+ import { kml } from "@maptiler/sdk";
1011
+
1012
+ // ... assuming inside an async function
1013
+
1014
+ // Fetching the KML file as a string:
1015
+ const kmlFilePath = "some_gps_trace.kml";
1016
+ const kmlResponse = await fetch(kmlFilePath);
1017
+ const kmlStr = await res.text();
1018
+
1019
+ // Converting the KML payload into a GeoJSON FeatureCollection:
1020
+ const features = maptilersdk.gpx(kmlStr);
1021
+ ```
1022
+
1023
+
991
1024
  ## Take Screenshots, programmatically
992
1025
  There are two different ways to create screenshot, corresponding to two very different usecases. Note that screenshots will not contain *DOM elements* such as `Marker` and `Popup`, since those are not part of the rendering context.
993
1026