@maptiler/client 2.8.0-rc.1 → 3.0.0-rc.2

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/CHANGELOG.md CHANGED
@@ -1,15 +1,20 @@
1
1
  # MapTiler Client Changelog
2
2
 
3
- ## NEXT
3
+ ## 3.0.0
4
+
5
+ ### ⚠️ Breaking Changes
6
+ - The default styles of Satellite, Hybrid, Dataviz, Outdoor, Winter, Backdrop, Aquarelle, Ocean, Top, Base and Landscape all point to v4 as their default style. V2 styles are still available under under the `_V2` suffixed namespace eg `MapStyle.STREETS_V2.DEFAULT`.
4
7
 
5
8
  ### New Features
6
9
  - Adds new option `adjustSearchParams` to all functions in `geocoding` module
7
10
 
8
11
  ### Bug Fixes
9
- None
12
+ - Fixes `elevation.batch` skipping the last kernel (group of coordinates) when smoothing the result
13
+ - Fixes language helpers `toLanguageInfo` and `areSameLanguages` not working with keys from `Language` enum (like `"ENGLISH"`)
14
+ - Fixes language helper `areSameLanguages` to always return boolean (it could return `null` before)
10
15
 
11
16
  ### Others
12
- None
17
+ - Default value of `types` option of Geocoding API Client changed, TSDoc now links to API docs instead of listing the default types explicitly
13
18
 
14
19
  ## 2.7.0
15
20
 
@@ -955,7 +955,7 @@ const Language = {
955
955
  };
956
956
  function getLanguageInfoFromKey(languageKey, languageDictionary = Language) {
957
957
  if (languageKey in languageDictionary) {
958
- return languageKey[languageKey];
958
+ return languageDictionary[languageKey];
959
959
  }
960
960
  return null;
961
961
  }
@@ -1001,7 +1001,7 @@ function toLanguageInfo(lang, languageDictionary = Language) {
1001
1001
  function areSameLanguages(langA, langB, languageDictionary = Language) {
1002
1002
  const langAObj = toLanguageInfo(langA, languageDictionary);
1003
1003
  const langBObj = toLanguageInfo(langB, languageDictionary);
1004
- return langAObj && langBObj && langAObj.flag === langBObj.flag;
1004
+ return langAObj !== null && langBObj !== null && langAObj.flag === langBObj.flag;
1005
1005
  }
1006
1006
 
1007
1007
  async function callFetch(resource, options = {}) {
@@ -2298,19 +2298,20 @@ const MAP_STYLE_CONFIG = [
2298
2298
  }
2299
2299
  ];
2300
2300
  const defaultReferenceStyleMap = {
2301
- STREETS: "STREETS_V2",
2301
+ STREETS: "STREETS_V4",
2302
2302
  BASIC: "BASIC_V2",
2303
- LANDSCAPE: "LANDSCAPE_V2",
2304
- AQUARELLE: "AQUARELLE_V2",
2305
- SATELLITE: "SATELLITE_V2",
2306
- WINTER: "WINTER_V2",
2307
- HYBRID: "HYBRID_V2",
2308
- OCEAN: "OCEAN_V2",
2303
+ BASE: "BASE_V4",
2304
+ LANDSCAPE: "LANDSCAPE_V4",
2305
+ AQUARELLE: "AQUARELLE_V4",
2306
+ SATELLITE: "SATELLITE_V4",
2307
+ WINTER: "WINTER_V4",
2308
+ HYBRID: "HYBRID_V4",
2309
+ OCEAN: "OCEAN_V4",
2309
2310
  TONER: "TONER_V2",
2310
- TOPO: "TOPO_V2",
2311
+ TOPO: "TOPO_V4",
2311
2312
  OPENSTREETMAP: "OPENSTREETMAP_V2",
2312
- DATAVIZ: "DATAVIZ_V2",
2313
- BACKDROP: "BACKDROP_V2",
2313
+ DATAVIZ: "DATAVIZ_V4",
2314
+ BACKDROP: "BACKDROP_V4",
2314
2315
  VOYAGER: "VOYAGER_V2"
2315
2316
  };
2316
2317
  const mapStylePresetList = [
@@ -3257,7 +3258,7 @@ async function batch(positions, options = {}) {
3257
3258
  const kernelSize = ~~(options.smoothingKernelSize / 2) * 2 + 1;
3258
3259
  const elevations = elevatedPositions.map((pos) => pos[2]);
3259
3260
  const kernelSpan = ~~(kernelSize / 2);
3260
- for (let i = kernelSpan; i < elevations.length - kernelSpan - 1; i += 1) {
3261
+ for (let i = kernelSpan; i < elevations.length - kernelSpan; i += 1) {
3261
3262
  let sum = 0;
3262
3263
  for (let j = 0; j < kernelSize; j += 1) {
3263
3264
  const elev = elevations[i - kernelSpan + j];
@@ -3319,6 +3320,7 @@ exports.circumferenceAtLatitude = circumferenceAtLatitude;
3319
3320
  exports.config = config;
3320
3321
  exports.coordinates = coordinates;
3321
3322
  exports.data = data;
3323
+ exports.defaultReferenceStyleMap = defaultReferenceStyleMap;
3322
3324
  exports.elevation = elevation;
3323
3325
  exports.expandMapStyle = expandMapStyle;
3324
3326
  exports.geocoding = geocoding;