You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,19 @@
8
8
### Bug Fixes
9
9
- Navigation now relies on `Map` methods instead of `Transform` methods for bearing due to globe projection being available
10
10
11
+
## 2.5.1
12
+
### Bug Fixes
13
+
- Better control of the status of `monitoredStyleUrls` in Map instance when error is caught (https://github.com/maptiler/maptiler-sdk-js/pull/141)
14
+
- Added extra integrity checks on style object when updating language (https://github.com/maptiler/maptiler-sdk-js/pull/142)
15
+
- The Geolocate control no longer throwing error when window is lost (issue on Firefox only) (https://github.com/maptiler/maptiler-sdk-js/pull/140)
16
+
17
+
## 2.5.0
18
+
### others
19
+
- Update MapTiler Client library to v2.5.0
11
20
12
21
## 2.4.2
13
22
### Bug Fixes
14
23
- The language switching is now more robust and preserves the original formatting from the style (`Map.setPrimaryLangage()`) (https://github.com/maptiler/maptiler-sdk-js/pull/134)
15
-
16
24
### Others
17
25
- Now able to GitHub action a beta on NPM from the GH release creation process
Copy file name to clipboardExpand all lines: readme.md
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1103,7 +1103,40 @@ Turning off *zoom compensation* allows for more accurate adjustments to the visu
1103
1103
1104
1104
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).
1105
1105
1106
-
# Other helper
1106
+
# Other helpers
1107
+
## Convert GPX and KML to GeoJSON
1108
+
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:
1109
+
1110
+
```ts
1111
+
import { gpx } from"@maptiler/sdk";
1112
+
1113
+
// ... assuming inside an async function
1114
+
1115
+
// Fetching the GPX file as a string:
1116
+
const gpxFilePath ="some_gps_trace.gpx";
1117
+
const gpxResponse =awaitfetch(gpxFilePath);
1118
+
const gpxStr =awaitres.text();
1119
+
1120
+
// Converting the GPX payload into a GeoJSON FeatureCollection:
1121
+
const features =maptilersdk.gpx(gpxStr);
1122
+
```
1123
+
1124
+
And for KML files:
1125
+
```ts
1126
+
import { kml } from"@maptiler/sdk";
1127
+
1128
+
// ... assuming inside an async function
1129
+
1130
+
// Fetching the KML file as a string:
1131
+
const kmlFilePath ="some_gps_trace.kml";
1132
+
const kmlResponse =awaitfetch(kmlFilePath);
1133
+
const kmlStr =awaitres.text();
1134
+
1135
+
// Converting the KML payload into a GeoJSON FeatureCollection:
1136
+
const features =maptilersdk.gpx(kmlStr);
1137
+
```
1138
+
1139
+
1107
1140
## Take Screenshots, programmatically
1108
1141
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.
0 commit comments