@maptiler/client 1.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/client",
3
- "version": "1.8.1",
3
+ "version": "2.0.0",
4
4
  "description": "Javascript & Typescript wrapper to MapTiler Cloud API",
5
5
  "module": "dist/maptiler-client.mjs",
6
6
  "types": "dist/maptiler-client.d.ts",
@@ -56,6 +56,8 @@
56
56
  "@rollup/plugin-commonjs": "^25.0.7",
57
57
  "@rollup/plugin-json": "^6.0.1",
58
58
  "@rollup/plugin-node-resolve": "^15.2.3",
59
+ "@rollup/pluginutils": "^5.0.5",
60
+ "@types/geojson": "^7946.0.10",
59
61
  "@typescript-eslint/eslint-plugin": "^6.9.0",
60
62
  "@typescript-eslint/parser": "^6.9.0",
61
63
  "eslint": "^8.52.0",
@@ -71,9 +73,7 @@
71
73
  "typedoc": "^0.25.2",
72
74
  "typedoc-plugin-markdown": "^3.16.0",
73
75
  "typescript": "^5.2.2",
74
- "vitest": "^0.34.6",
75
- "@rollup/pluginutils": "^5.0.5",
76
- "@types/geojson": "^7946.0.10"
76
+ "vitest": "^0.34.6"
77
77
  },
78
78
  "dependencies": {
79
79
  "quick-lru": "^7.0.0"
package/readme.md CHANGED
@@ -21,7 +21,7 @@
21
21
  The **MapTiler Client JS** exposes a number of handy functions that wrap API call to [MapTiler Cloud API services](https://docs.maptiler.com/cloud/api), such as:
22
22
  - [Geocoding forward and reverse](#-geocoding)
23
23
  - [Geolocation from visitor's IP address](#%EF%B8%8F%EF%B8%8F-geolocation)
24
- - [Coordidinate systems search and tranform](#-coordinates)
24
+ - [Coordinate systems search and tranform](#-coordinates)
25
25
  - [User data fetching as GeoJSON](#-data)
26
26
  - [Static maps of all sorts](#%EF%B8%8F-static-maps)
27
27
  - [Elevation lookup with batch features](#-elevation)
@@ -96,14 +96,16 @@ The same option object as the forward geocoding can be provided.
96
96
  Read more about reverse geocoding on our [official documentation](https://docs.maptiler.com/client-js/geocoding/#reverse).
97
97
 
98
98
  ### Language
99
- For both *forward* and *reverse* geocoding, this library provides a list of supported languages as shorthands to [ISO language codes](https://en.wikipedia.org/wiki/ISO_639-1). The result will be provided in multiple languages if the `language` options is an array:
99
+ For both *forward* and *reverse* geocoding, this library provides a list of supported languages as shorthands that include [ISO language codes](https://en.wikipedia.org/wiki/ISO_639-1). The result will be provided in multiple languages if the `language` options is an array:
100
100
 
101
101
  ```ts
102
- const result = await maptilerClient.geocoding.forward('paris', {language: [maptilerClient.geocoding.languages.SPANISH, maptilerClient.geocoding.languages.KOREAN]})
102
+ const result = await maptilerClient.geocoding.forward('paris', {language: [maptilerClient.Language.SPANISH, maptilerClient.geocoding.Language.KOREAN]})
103
103
  ```
104
104
 
105
105
  The special language `AUTO` will detect the platform/browser preferred language.
106
106
 
107
+ If the language is not specified as options, MapTiler Cloud will use the `Accept-language` from the HTTP header of the request. The language seleted this way is generaly similar to the `Language.AUTO` mode, but can still differ in some cases ([read more](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language)).
108
+
107
109
  ## 🕵️‍♂️ Geolocation
108
110
  The geolocation service provides location informations of a visitor using its IP address.
109
111