@maptiler/client 1.0.3 → 1.1.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.
Files changed (72) hide show
  1. package/dist/maptiler-client.cjs +586 -21
  2. package/dist/maptiler-client.cjs.map +1 -1
  3. package/dist/maptiler-client.d.ts +405 -2
  4. package/dist/maptiler-client.min.mjs +1 -1
  5. package/dist/maptiler-client.mjs +582 -22
  6. package/dist/maptiler-client.mjs.map +1 -1
  7. package/dist/maptiler-client.umd.js +586 -21
  8. package/dist/maptiler-client.umd.js.map +1 -1
  9. package/dist/maptiler-client.umd.min.js +1 -1
  10. package/docs/assets/custom.css +28 -1
  11. package/docs/classes/config.ClientConfig.html +9 -9
  12. package/docs/classes/services_ServiceError.ServiceError.html +7 -7
  13. package/docs/functions/language.getAutoLanguageGeocoding.html +5 -5
  14. package/docs/functions/services_simplify.default.html +5 -5
  15. package/docs/index.html +111 -30
  16. package/docs/modules/config.html +5 -5
  17. package/docs/modules/language.html +5 -5
  18. package/docs/modules/services_ServiceError.html +5 -5
  19. package/docs/modules/services_coordinates.html +5 -5
  20. package/docs/modules/services_data.html +5 -5
  21. package/docs/modules/services_geocoding.html +5 -5
  22. package/docs/modules/services_geolocation.html +5 -5
  23. package/docs/modules/services_simplify.html +5 -5
  24. package/docs/modules/services_staticMaps.html +5 -5
  25. package/docs/modules.html +4 -4
  26. package/docs/types/config.FetchFunction.html +5 -5
  27. package/docs/types/language.LanguageGeocodingString.html +5 -5
  28. package/docs/types/services_coordinates.CoordinateExport.html +5 -5
  29. package/docs/types/services_coordinates.CoordinateGrid.html +5 -5
  30. package/docs/types/services_coordinates.CoordinateId.html +5 -5
  31. package/docs/types/services_coordinates.CoordinateSearch.html +5 -5
  32. package/docs/types/services_coordinates.CoordinateSearchResult.html +5 -5
  33. package/docs/types/services_coordinates.CoordinateTransformResult.html +5 -5
  34. package/docs/types/services_coordinates.CoordinateTransformation.html +5 -5
  35. package/docs/types/services_coordinates.CoordinatesSearchOptions.html +5 -5
  36. package/docs/types/services_coordinates.CoordinatesTransformOptions.html +5 -5
  37. package/docs/types/services_coordinates.XYZ.html +5 -5
  38. package/docs/types/services_data.GetDataOptions.html +5 -5
  39. package/docs/types/services_geocoding.Coordinates.html +5 -5
  40. package/docs/types/services_geocoding.FeatureHierarchy.html +5 -5
  41. package/docs/types/services_geocoding.GeocodingFeature.html +5 -5
  42. package/docs/types/services_geocoding.GeocodingOptions.html +5 -5
  43. package/docs/types/services_geocoding.GeocodingSearchResult.html +5 -5
  44. package/docs/types/services_geocoding.ReverseGeocodingOptions.html +5 -5
  45. package/docs/types/services_geolocation.GeolocationInfoOptions.html +5 -5
  46. package/docs/types/services_geolocation.GeolocationResult.html +5 -5
  47. package/docs/types/services_staticMaps.AutomaticStaticMapOptions.html +5 -5
  48. package/docs/types/services_staticMaps.BoundedStaticMapOptions.html +5 -5
  49. package/docs/types/services_staticMaps.CenteredStaticMapOptions.html +5 -5
  50. package/docs/types/services_staticMaps.StaticMapBaseOptions.html +7 -7
  51. package/docs/types/services_staticMaps.StaticMapMarker.html +5 -5
  52. package/docs/variables/config.config.html +5 -5
  53. package/docs/variables/language.LanguageGeocoding.html +5 -5
  54. package/docs/variables/services_coordinates.coordinates.html +5 -5
  55. package/docs/variables/services_data.data.html +5 -5
  56. package/docs/variables/services_geocoding.geocoding.html +5 -5
  57. package/docs/variables/services_geolocation.geolocation.html +5 -5
  58. package/docs/variables/services_staticMaps.staticMaps.html +5 -5
  59. package/docsmd/README.md +145 -36
  60. package/docsmd/assets/custom.css +28 -1
  61. package/docsmd/classes/ClientConfig.md +5 -5
  62. package/docsmd/classes/MapStyleVariant.md +234 -0
  63. package/docsmd/classes/ReferenceMapStyle.md +169 -0
  64. package/docsmd/classes/ServiceError.md +3 -3
  65. package/examples/test-browser-umd.html +1 -1
  66. package/package.json +1 -1
  67. package/readme.md +86 -27
  68. package/src/index.ts +17 -0
  69. package/src/mapstyle.ts +874 -0
  70. package/src/services/staticMaps.ts +5 -4
  71. package/tsconfig.json +0 -1
  72. package/typedoc.css +28 -1
@@ -0,0 +1,234 @@
1
+ [MapTiler Client - v1.1.1](../README.md) / MapStyleVariant
2
+
3
+ # Class: MapStyleVariant
4
+
5
+ An instance of MapStyleVariant contains information about a style to use that belong to a reference style
6
+
7
+ ## Table of contents
8
+
9
+ ### Constructors
10
+
11
+ - [constructor](MapStyleVariant.md#constructor)
12
+
13
+ ### Methods
14
+
15
+ - [getDescription](MapStyleVariant.md#getdescription)
16
+ - [getExpandedStyleURL](MapStyleVariant.md#getexpandedstyleurl)
17
+ - [getFullName](MapStyleVariant.md#getfullname)
18
+ - [getId](MapStyleVariant.md#getid)
19
+ - [getImageURL](MapStyleVariant.md#getimageurl)
20
+ - [getName](MapStyleVariant.md#getname)
21
+ - [getReferenceStyle](MapStyleVariant.md#getreferencestyle)
22
+ - [getType](MapStyleVariant.md#gettype)
23
+ - [getVariant](MapStyleVariant.md#getvariant)
24
+ - [getVariants](MapStyleVariant.md#getvariants)
25
+ - [hasVariant](MapStyleVariant.md#hasvariant)
26
+
27
+ ## Constructors
28
+
29
+ ### constructor
30
+
31
+ • **new MapStyleVariant**(`name`, `variantType`, `id`, `referenceStyle`, `description`, `imageURL`)
32
+
33
+ #### Parameters
34
+
35
+ | Name | Type | Description |
36
+ | :------ | :------ | :------ |
37
+ | `name` | `string` | Human-friendly name |
38
+ | `variantType` | `string` | Variant name the variant is addressed to from its reference style: `MapStyle.REFERNCE_STYLE_NAME.VARIANT_TYPE` |
39
+ | `id` | `string` | MapTiler Cloud id |
40
+ | `referenceStyle` | [`ReferenceMapStyle`](ReferenceMapStyle.md) | Reference map style, used to retrieve sibling variants |
41
+ | `description` | `string` | Human-friendly description |
42
+ | `imageURL` | `string` | URL to an image describing the style variant |
43
+
44
+ #### Defined in
45
+
46
+ [mapstyle.ts:46](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L46)
47
+
48
+ ## Methods
49
+
50
+ ### getDescription
51
+
52
+ ▸ **getDescription**(): `string`
53
+
54
+ Get the human-friendly description
55
+
56
+ #### Returns
57
+
58
+ `string`
59
+
60
+ #### Defined in
61
+
62
+ [mapstyle.ts:109](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L109)
63
+
64
+ ___
65
+
66
+ ### getExpandedStyleURL
67
+
68
+ ▸ **getExpandedStyleURL**(): `string`
69
+
70
+ Get the style as usable by MapLibre, a string (URL) or a plain style description (StyleSpecification)
71
+
72
+ #### Returns
73
+
74
+ `string`
75
+
76
+ #### Defined in
77
+
78
+ [mapstyle.ts:161](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L161)
79
+
80
+ ___
81
+
82
+ ### getFullName
83
+
84
+ ▸ **getFullName**(): `string`
85
+
86
+ #### Returns
87
+
88
+ `string`
89
+
90
+ #### Defined in
91
+
92
+ [mapstyle.ts:86](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L86)
93
+
94
+ ___
95
+
96
+ ### getId
97
+
98
+ ▸ **getId**(): `string`
99
+
100
+ Get the MapTiler Cloud id
101
+
102
+ #### Returns
103
+
104
+ `string`
105
+
106
+ #### Defined in
107
+
108
+ [mapstyle.ts:102](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L102)
109
+
110
+ ___
111
+
112
+ ### getImageURL
113
+
114
+ ▸ **getImageURL**(): `string`
115
+
116
+ Get the image URL that represent _this_ variant
117
+
118
+ #### Returns
119
+
120
+ `string`
121
+
122
+ #### Defined in
123
+
124
+ [mapstyle.ts:153](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L153)
125
+
126
+ ___
127
+
128
+ ### getName
129
+
130
+ ▸ **getName**(): `string`
131
+
132
+ Get the human-friendly name
133
+
134
+ #### Returns
135
+
136
+ `string`
137
+
138
+ #### Defined in
139
+
140
+ [mapstyle.ts:82](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L82)
141
+
142
+ ___
143
+
144
+ ### getReferenceStyle
145
+
146
+ ▸ **getReferenceStyle**(): [`ReferenceMapStyle`](ReferenceMapStyle.md)
147
+
148
+ Get the reference style this variant belongs to
149
+
150
+ #### Returns
151
+
152
+ [`ReferenceMapStyle`](ReferenceMapStyle.md)
153
+
154
+ #### Defined in
155
+
156
+ [mapstyle.ts:117](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L117)
157
+
158
+ ___
159
+
160
+ ### getType
161
+
162
+ ▸ **getType**(): `string`
163
+
164
+ Get the variant type (eg. "DEFAULT", "DARK", "PASTEL", etc.)
165
+
166
+ #### Returns
167
+
168
+ `string`
169
+
170
+ #### Defined in
171
+
172
+ [mapstyle.ts:94](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L94)
173
+
174
+ ___
175
+
176
+ ### getVariant
177
+
178
+ ▸ **getVariant**(`variantType`): [`MapStyleVariant`](MapStyleVariant.md)
179
+
180
+ Retrieve the variant of a given type. If not found, will return the "DEFAULT" variant.
181
+ (eg. _this_ "DARK" variant does not have any "PASTEL" variant, then the "DEFAULT" is returned)
182
+
183
+ #### Parameters
184
+
185
+ | Name | Type |
186
+ | :------ | :------ |
187
+ | `variantType` | `string` |
188
+
189
+ #### Returns
190
+
191
+ [`MapStyleVariant`](MapStyleVariant.md)
192
+
193
+ #### Defined in
194
+
195
+ [mapstyle.ts:137](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L137)
196
+
197
+ ___
198
+
199
+ ### getVariants
200
+
201
+ ▸ **getVariants**(): [`MapStyleVariant`](MapStyleVariant.md)[]
202
+
203
+ Get all the variants for _this_ variants, except _this_ current one
204
+
205
+ #### Returns
206
+
207
+ [`MapStyleVariant`](MapStyleVariant.md)[]
208
+
209
+ #### Defined in
210
+
211
+ [mapstyle.ts:145](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L145)
212
+
213
+ ___
214
+
215
+ ### hasVariant
216
+
217
+ ▸ **hasVariant**(`variantType`): `boolean`
218
+
219
+ Check if a variant of a given type exists for _this_ variants
220
+ (eg. if this is a "DARK", then we can check if there is a "LIGHT" variant of it)
221
+
222
+ #### Parameters
223
+
224
+ | Name | Type |
225
+ | :------ | :------ |
226
+ | `variantType` | `string` |
227
+
228
+ #### Returns
229
+
230
+ `boolean`
231
+
232
+ #### Defined in
233
+
234
+ [mapstyle.ts:127](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L127)
@@ -0,0 +1,169 @@
1
+ [MapTiler Client - v1.1.1](../README.md) / ReferenceMapStyle
2
+
3
+ # Class: ReferenceMapStyle
4
+
5
+ An instance of reference style contains a list of StyleVariants ordered by relevance
6
+
7
+ ## Table of contents
8
+
9
+ ### Constructors
10
+
11
+ - [constructor](ReferenceMapStyle.md#constructor)
12
+
13
+ ### Methods
14
+
15
+ - [addVariant](ReferenceMapStyle.md#addvariant)
16
+ - [getDefaultVariant](ReferenceMapStyle.md#getdefaultvariant)
17
+ - [getId](ReferenceMapStyle.md#getid)
18
+ - [getName](ReferenceMapStyle.md#getname)
19
+ - [getVariant](ReferenceMapStyle.md#getvariant)
20
+ - [getVariants](ReferenceMapStyle.md#getvariants)
21
+ - [hasVariant](ReferenceMapStyle.md#hasvariant)
22
+
23
+ ## Constructors
24
+
25
+ ### constructor
26
+
27
+ • **new ReferenceMapStyle**(`name`, `id`)
28
+
29
+ #### Parameters
30
+
31
+ | Name | Type | Description |
32
+ | :------ | :------ | :------ |
33
+ | `name` | `string` | Human-friendly name of this reference style |
34
+ | `id` | `string` | ID of this reference style |
35
+
36
+ #### Defined in
37
+
38
+ [mapstyle.ts:180](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L180)
39
+
40
+ ## Methods
41
+
42
+ ### addVariant
43
+
44
+ ▸ **addVariant**(`v`): `void`
45
+
46
+ Add a variant to _this_ reference style
47
+
48
+ #### Parameters
49
+
50
+ | Name | Type |
51
+ | :------ | :------ |
52
+ | `v` | [`MapStyleVariant`](MapStyleVariant.md) |
53
+
54
+ #### Returns
55
+
56
+ `void`
57
+
58
+ #### Defined in
59
+
60
+ [mapstyle.ts:212](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L212)
61
+
62
+ ___
63
+
64
+ ### getDefaultVariant
65
+
66
+ ▸ **getDefaultVariant**(): [`MapStyleVariant`](MapStyleVariant.md)
67
+
68
+ Get the defualt variant for this reference style
69
+
70
+ #### Returns
71
+
72
+ [`MapStyleVariant`](MapStyleVariant.md)
73
+
74
+ #### Defined in
75
+
76
+ [mapstyle.ts:250](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L250)
77
+
78
+ ___
79
+
80
+ ### getId
81
+
82
+ ▸ **getId**(): `string`
83
+
84
+ Get the id of _this_ reference style
85
+
86
+ #### Returns
87
+
88
+ `string`
89
+
90
+ #### Defined in
91
+
92
+ [mapstyle.ts:204](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L204)
93
+
94
+ ___
95
+
96
+ ### getName
97
+
98
+ ▸ **getName**(): `string`
99
+
100
+ Get the human-friendly name of this reference style
101
+
102
+ #### Returns
103
+
104
+ `string`
105
+
106
+ #### Defined in
107
+
108
+ [mapstyle.ts:196](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L196)
109
+
110
+ ___
111
+
112
+ ### getVariant
113
+
114
+ ▸ **getVariant**(`variantType`): [`MapStyleVariant`](MapStyleVariant.md)
115
+
116
+ Get a given variant. If the given type of variant does not exist for this reference style,
117
+ then the most relevant default variant is returned instead
118
+
119
+ #### Parameters
120
+
121
+ | Name | Type |
122
+ | :------ | :------ |
123
+ | `variantType` | `string` |
124
+
125
+ #### Returns
126
+
127
+ [`MapStyleVariant`](MapStyleVariant.md)
128
+
129
+ #### Defined in
130
+
131
+ [mapstyle.ts:232](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L232)
132
+
133
+ ___
134
+
135
+ ### getVariants
136
+
137
+ ▸ **getVariants**(): [`MapStyleVariant`](MapStyleVariant.md)[]
138
+
139
+ Get the list of variants for this reference style
140
+
141
+ #### Returns
142
+
143
+ [`MapStyleVariant`](MapStyleVariant.md)[]
144
+
145
+ #### Defined in
146
+
147
+ [mapstyle.ts:242](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L242)
148
+
149
+ ___
150
+
151
+ ### hasVariant
152
+
153
+ ▸ **hasVariant**(`variantType`): `boolean`
154
+
155
+ Check if a given variant type exists for this reference style
156
+
157
+ #### Parameters
158
+
159
+ | Name | Type |
160
+ | :------ | :------ |
161
+ | `variantType` | `string` |
162
+
163
+ #### Returns
164
+
165
+ `boolean`
166
+
167
+ #### Defined in
168
+
169
+ [mapstyle.ts:222](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/mapstyle.ts#L222)
@@ -1,4 +1,4 @@
1
- [MapTiler Client - v1.0.3](../README.md) / ServiceError
1
+ [MapTiler Client - v1.1.1](../README.md) / ServiceError
2
2
 
3
3
  # Class: ServiceError
4
4
 
@@ -39,7 +39,7 @@ Error.constructor
39
39
 
40
40
  #### Defined in
41
41
 
42
- [services/ServiceError.ts:5](https://github.com/maptiler/maptiler-client-js/blob/05ded3a/src/services/ServiceError.ts#L5)
42
+ [services/ServiceError.ts:5](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/services/ServiceError.ts#L5)
43
43
 
44
44
  ## Properties
45
45
 
@@ -49,4 +49,4 @@ Error.constructor
49
49
 
50
50
  #### Defined in
51
51
 
52
- [services/ServiceError.ts:5](https://github.com/maptiler/maptiler-client-js/blob/05ded3a/src/services/ServiceError.ts#L5)
52
+ [services/ServiceError.ts:5](https://github.com/maptiler/maptiler-client-js/blob/37740e0/src/services/ServiceError.ts#L5)
@@ -66,7 +66,7 @@
66
66
  hiDPI: true,
67
67
  width: 1024,
68
68
  height: 2048,
69
- style: 'streets-v2',
69
+ style: maptilerclient.MapStyle.STAGE.DARK,
70
70
  path: [[-9.8905, 36.6274], [-9.8905, 42.3208], [-6.0453, 42.3208], [-6.0453, 36.6274], [-9.8905, 36.6274]],
71
71
  pathStrokeColor: 'red',
72
72
  pathWidth: 4,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maptiler/client",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
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",