@maptiler/client 1.8.0 → 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/.eslintrc.cjs +4 -0
- package/CHANGELOG.md +11 -1
- package/dist/maptiler-client.cjs +1268 -83
- package/dist/maptiler-client.cjs.map +1 -1
- package/dist/maptiler-client.d.ts +414 -122
- package/dist/maptiler-client.min.mjs +1 -1
- package/dist/maptiler-client.mjs +967 -80
- package/dist/maptiler-client.mjs.map +1 -1
- package/package.json +3 -3
- package/readme.md +5 -3
- package/rollup.config.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maptiler/client",
|
|
3
|
-
"version": "
|
|
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",
|
|
@@ -74,8 +76,6 @@
|
|
|
74
76
|
"vitest": "^0.34.6"
|
|
75
77
|
},
|
|
76
78
|
"dependencies": {
|
|
77
|
-
"@rollup/pluginutils": "^5.0.5",
|
|
78
|
-
"@types/geojson": "^7946.0.10",
|
|
79
79
|
"quick-lru": "^7.0.0"
|
|
80
80
|
}
|
|
81
81
|
}
|
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
|
-
- [
|
|
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
|
|
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.
|
|
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
|
|
package/rollup.config.js
CHANGED
|
@@ -25,7 +25,7 @@ const bundles = [
|
|
|
25
25
|
watch: {
|
|
26
26
|
include: "src/**"
|
|
27
27
|
},
|
|
28
|
-
external: ["
|
|
28
|
+
external: ["quick-lru"]
|
|
29
29
|
},
|
|
30
30
|
|
|
31
31
|
// CJS module, not minified + sourcemap
|
|
@@ -48,7 +48,7 @@ const bundles = [
|
|
|
48
48
|
watch: {
|
|
49
49
|
include: "src/**"
|
|
50
50
|
},
|
|
51
|
-
external: [
|
|
51
|
+
external: [] // Decided to include QuickLRU to the CJS bundle because it is otherwise not CJS compatible
|
|
52
52
|
},
|
|
53
53
|
|
|
54
54
|
// UMD module, not minified
|
|
@@ -106,7 +106,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
106
106
|
}
|
|
107
107
|
],
|
|
108
108
|
input: "src/index.ts",
|
|
109
|
-
external: ["
|
|
109
|
+
external: ["quick-lru"],
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
plugins: [
|