@maptiler/client 1.1.1 → 1.1.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/dist/maptiler-client.umd.js +1 -1
- package/dist/maptiler-client.umd.min.js +1 -1
- package/docs/classes/config.ClientConfig.html +9 -9
- package/docs/classes/services_ServiceError.ServiceError.html +7 -7
- package/docs/functions/language.getAutoLanguageGeocoding.html +5 -5
- package/docs/functions/services_simplify.default.html +5 -5
- package/docs/index.html +4 -4
- package/docs/modules/config.html +5 -5
- package/docs/modules/language.html +5 -5
- package/docs/modules/services_ServiceError.html +5 -5
- package/docs/modules/services_coordinates.html +5 -5
- package/docs/modules/services_data.html +5 -5
- package/docs/modules/services_geocoding.html +5 -5
- package/docs/modules/services_geolocation.html +5 -5
- package/docs/modules/services_simplify.html +5 -5
- package/docs/modules/services_staticMaps.html +5 -5
- package/docs/modules.html +4 -4
- package/docs/types/config.FetchFunction.html +5 -5
- package/docs/types/language.LanguageGeocodingString.html +5 -5
- package/docs/types/services_coordinates.CoordinateExport.html +5 -5
- package/docs/types/services_coordinates.CoordinateGrid.html +5 -5
- package/docs/types/services_coordinates.CoordinateId.html +5 -5
- package/docs/types/services_coordinates.CoordinateSearch.html +5 -5
- package/docs/types/services_coordinates.CoordinateSearchResult.html +5 -5
- package/docs/types/services_coordinates.CoordinateTransformResult.html +5 -5
- package/docs/types/services_coordinates.CoordinateTransformation.html +5 -5
- package/docs/types/services_coordinates.CoordinatesSearchOptions.html +5 -5
- package/docs/types/services_coordinates.CoordinatesTransformOptions.html +5 -5
- package/docs/types/services_coordinates.XYZ.html +5 -5
- package/docs/types/services_data.GetDataOptions.html +5 -5
- package/docs/types/services_geocoding.Coordinates.html +5 -5
- package/docs/types/services_geocoding.FeatureHierarchy.html +5 -5
- package/docs/types/services_geocoding.GeocodingFeature.html +5 -5
- package/docs/types/services_geocoding.GeocodingOptions.html +5 -5
- package/docs/types/services_geocoding.GeocodingSearchResult.html +5 -5
- package/docs/types/services_geocoding.ReverseGeocodingOptions.html +5 -5
- package/docs/types/services_geolocation.GeolocationInfoOptions.html +5 -5
- package/docs/types/services_geolocation.GeolocationResult.html +5 -5
- package/docs/types/services_staticMaps.AutomaticStaticMapOptions.html +5 -5
- package/docs/types/services_staticMaps.BoundedStaticMapOptions.html +5 -5
- package/docs/types/services_staticMaps.CenteredStaticMapOptions.html +5 -5
- package/docs/types/services_staticMaps.StaticMapBaseOptions.html +5 -5
- package/docs/types/services_staticMaps.StaticMapMarker.html +5 -5
- package/docs/variables/config.config.html +5 -5
- package/docs/variables/language.LanguageGeocoding.html +5 -5
- package/docs/variables/services_coordinates.coordinates.html +5 -5
- package/docs/variables/services_data.data.html +5 -5
- package/docs/variables/services_geocoding.geocoding.html +5 -5
- package/docs/variables/services_geolocation.geolocation.html +5 -5
- package/docs/variables/services_staticMaps.staticMaps.html +5 -5
- package/docsmd/README.md +40 -40
- package/docsmd/classes/ClientConfig.md +5 -5
- package/docsmd/classes/MapStyleVariant.md +13 -13
- package/docsmd/classes/ReferenceMapStyle.md +9 -9
- package/docsmd/classes/ServiceError.md +3 -3
- package/examples/test-browser-es.html +2 -1
- package/examples/test-browser-umd.html +17 -16
- package/package.json +1 -1
- package/rollup.config.js +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[MapTiler Client - v1.1.
|
|
1
|
+
[MapTiler Client - v1.1.2](../README.md) / MapStyleVariant
|
|
2
2
|
|
|
3
3
|
# Class: MapStyleVariant
|
|
4
4
|
|
|
@@ -43,7 +43,7 @@ An instance of MapStyleVariant contains information about a style to use that be
|
|
|
43
43
|
|
|
44
44
|
#### Defined in
|
|
45
45
|
|
|
46
|
-
[mapstyle.ts:46](https://github.com/maptiler/maptiler-client-js/blob/
|
|
46
|
+
[mapstyle.ts:46](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L46)
|
|
47
47
|
|
|
48
48
|
## Methods
|
|
49
49
|
|
|
@@ -59,7 +59,7 @@ Get the human-friendly description
|
|
|
59
59
|
|
|
60
60
|
#### Defined in
|
|
61
61
|
|
|
62
|
-
[mapstyle.ts:109](https://github.com/maptiler/maptiler-client-js/blob/
|
|
62
|
+
[mapstyle.ts:109](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L109)
|
|
63
63
|
|
|
64
64
|
___
|
|
65
65
|
|
|
@@ -75,7 +75,7 @@ Get the style as usable by MapLibre, a string (URL) or a plain style description
|
|
|
75
75
|
|
|
76
76
|
#### Defined in
|
|
77
77
|
|
|
78
|
-
[mapstyle.ts:161](https://github.com/maptiler/maptiler-client-js/blob/
|
|
78
|
+
[mapstyle.ts:161](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L161)
|
|
79
79
|
|
|
80
80
|
___
|
|
81
81
|
|
|
@@ -89,7 +89,7 @@ ___
|
|
|
89
89
|
|
|
90
90
|
#### Defined in
|
|
91
91
|
|
|
92
|
-
[mapstyle.ts:86](https://github.com/maptiler/maptiler-client-js/blob/
|
|
92
|
+
[mapstyle.ts:86](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L86)
|
|
93
93
|
|
|
94
94
|
___
|
|
95
95
|
|
|
@@ -105,7 +105,7 @@ Get the MapTiler Cloud id
|
|
|
105
105
|
|
|
106
106
|
#### Defined in
|
|
107
107
|
|
|
108
|
-
[mapstyle.ts:102](https://github.com/maptiler/maptiler-client-js/blob/
|
|
108
|
+
[mapstyle.ts:102](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L102)
|
|
109
109
|
|
|
110
110
|
___
|
|
111
111
|
|
|
@@ -121,7 +121,7 @@ Get the image URL that represent _this_ variant
|
|
|
121
121
|
|
|
122
122
|
#### Defined in
|
|
123
123
|
|
|
124
|
-
[mapstyle.ts:153](https://github.com/maptiler/maptiler-client-js/blob/
|
|
124
|
+
[mapstyle.ts:153](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L153)
|
|
125
125
|
|
|
126
126
|
___
|
|
127
127
|
|
|
@@ -137,7 +137,7 @@ Get the human-friendly name
|
|
|
137
137
|
|
|
138
138
|
#### Defined in
|
|
139
139
|
|
|
140
|
-
[mapstyle.ts:82](https://github.com/maptiler/maptiler-client-js/blob/
|
|
140
|
+
[mapstyle.ts:82](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L82)
|
|
141
141
|
|
|
142
142
|
___
|
|
143
143
|
|
|
@@ -153,7 +153,7 @@ Get the reference style this variant belongs to
|
|
|
153
153
|
|
|
154
154
|
#### Defined in
|
|
155
155
|
|
|
156
|
-
[mapstyle.ts:117](https://github.com/maptiler/maptiler-client-js/blob/
|
|
156
|
+
[mapstyle.ts:117](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L117)
|
|
157
157
|
|
|
158
158
|
___
|
|
159
159
|
|
|
@@ -169,7 +169,7 @@ Get the variant type (eg. "DEFAULT", "DARK", "PASTEL", etc.)
|
|
|
169
169
|
|
|
170
170
|
#### Defined in
|
|
171
171
|
|
|
172
|
-
[mapstyle.ts:94](https://github.com/maptiler/maptiler-client-js/blob/
|
|
172
|
+
[mapstyle.ts:94](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L94)
|
|
173
173
|
|
|
174
174
|
___
|
|
175
175
|
|
|
@@ -192,7 +192,7 @@ Retrieve the variant of a given type. If not found, will return the "DEFAULT" va
|
|
|
192
192
|
|
|
193
193
|
#### Defined in
|
|
194
194
|
|
|
195
|
-
[mapstyle.ts:137](https://github.com/maptiler/maptiler-client-js/blob/
|
|
195
|
+
[mapstyle.ts:137](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L137)
|
|
196
196
|
|
|
197
197
|
___
|
|
198
198
|
|
|
@@ -208,7 +208,7 @@ Get all the variants for _this_ variants, except _this_ current one
|
|
|
208
208
|
|
|
209
209
|
#### Defined in
|
|
210
210
|
|
|
211
|
-
[mapstyle.ts:145](https://github.com/maptiler/maptiler-client-js/blob/
|
|
211
|
+
[mapstyle.ts:145](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L145)
|
|
212
212
|
|
|
213
213
|
___
|
|
214
214
|
|
|
@@ -231,4 +231,4 @@ Check if a variant of a given type exists for _this_ variants
|
|
|
231
231
|
|
|
232
232
|
#### Defined in
|
|
233
233
|
|
|
234
|
-
[mapstyle.ts:127](https://github.com/maptiler/maptiler-client-js/blob/
|
|
234
|
+
[mapstyle.ts:127](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L127)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[MapTiler Client - v1.1.
|
|
1
|
+
[MapTiler Client - v1.1.2](../README.md) / ReferenceMapStyle
|
|
2
2
|
|
|
3
3
|
# Class: ReferenceMapStyle
|
|
4
4
|
|
|
@@ -35,7 +35,7 @@ An instance of reference style contains a list of StyleVariants ordered by relev
|
|
|
35
35
|
|
|
36
36
|
#### Defined in
|
|
37
37
|
|
|
38
|
-
[mapstyle.ts:180](https://github.com/maptiler/maptiler-client-js/blob/
|
|
38
|
+
[mapstyle.ts:180](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L180)
|
|
39
39
|
|
|
40
40
|
## Methods
|
|
41
41
|
|
|
@@ -57,7 +57,7 @@ Add a variant to _this_ reference style
|
|
|
57
57
|
|
|
58
58
|
#### Defined in
|
|
59
59
|
|
|
60
|
-
[mapstyle.ts:212](https://github.com/maptiler/maptiler-client-js/blob/
|
|
60
|
+
[mapstyle.ts:212](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L212)
|
|
61
61
|
|
|
62
62
|
___
|
|
63
63
|
|
|
@@ -73,7 +73,7 @@ Get the defualt variant for this reference style
|
|
|
73
73
|
|
|
74
74
|
#### Defined in
|
|
75
75
|
|
|
76
|
-
[mapstyle.ts:250](https://github.com/maptiler/maptiler-client-js/blob/
|
|
76
|
+
[mapstyle.ts:250](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L250)
|
|
77
77
|
|
|
78
78
|
___
|
|
79
79
|
|
|
@@ -89,7 +89,7 @@ Get the id of _this_ reference style
|
|
|
89
89
|
|
|
90
90
|
#### Defined in
|
|
91
91
|
|
|
92
|
-
[mapstyle.ts:204](https://github.com/maptiler/maptiler-client-js/blob/
|
|
92
|
+
[mapstyle.ts:204](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L204)
|
|
93
93
|
|
|
94
94
|
___
|
|
95
95
|
|
|
@@ -105,7 +105,7 @@ Get the human-friendly name of this reference style
|
|
|
105
105
|
|
|
106
106
|
#### Defined in
|
|
107
107
|
|
|
108
|
-
[mapstyle.ts:196](https://github.com/maptiler/maptiler-client-js/blob/
|
|
108
|
+
[mapstyle.ts:196](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L196)
|
|
109
109
|
|
|
110
110
|
___
|
|
111
111
|
|
|
@@ -128,7 +128,7 @@ then the most relevant default variant is returned instead
|
|
|
128
128
|
|
|
129
129
|
#### Defined in
|
|
130
130
|
|
|
131
|
-
[mapstyle.ts:232](https://github.com/maptiler/maptiler-client-js/blob/
|
|
131
|
+
[mapstyle.ts:232](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L232)
|
|
132
132
|
|
|
133
133
|
___
|
|
134
134
|
|
|
@@ -144,7 +144,7 @@ Get the list of variants for this reference style
|
|
|
144
144
|
|
|
145
145
|
#### Defined in
|
|
146
146
|
|
|
147
|
-
[mapstyle.ts:242](https://github.com/maptiler/maptiler-client-js/blob/
|
|
147
|
+
[mapstyle.ts:242](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L242)
|
|
148
148
|
|
|
149
149
|
___
|
|
150
150
|
|
|
@@ -166,4 +166,4 @@ Check if a given variant type exists for this reference style
|
|
|
166
166
|
|
|
167
167
|
#### Defined in
|
|
168
168
|
|
|
169
|
-
[mapstyle.ts:222](https://github.com/maptiler/maptiler-client-js/blob/
|
|
169
|
+
[mapstyle.ts:222](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/mapstyle.ts#L222)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[MapTiler Client - v1.1.
|
|
1
|
+
[MapTiler Client - v1.1.2](../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/
|
|
42
|
+
[services/ServiceError.ts:5](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/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/
|
|
52
|
+
[services/ServiceError.ts:5](https://github.com/maptiler/maptiler-client-js/blob/ec0b213/src/services/ServiceError.ts#L5)
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
console.log(LanguageGeocoding);
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
// The API key must be in the URL param as `?key=ABCD1234`
|
|
30
|
+
config.apiKey = (new URLSearchParams(location.search)).get("key");
|
|
30
31
|
|
|
31
32
|
async function testGeocoding() {
|
|
32
33
|
console.log(await geocoding.forward('bordeaux', {language: [geocoding.language.SPANISH, geocoding.language.ENGLISH]}));
|
|
@@ -15,33 +15,34 @@
|
|
|
15
15
|
<script src ="../dist/maptiler-client.umd.js"></script>
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
|
-
|
|
18
|
+
// The API key must be in the URL param as `?key=ABCD1234`
|
|
19
|
+
maptilerClient.config.apiKey = (new URLSearchParams(location.search)).get("key");
|
|
19
20
|
|
|
20
21
|
async function testGeocoding() {
|
|
21
|
-
console.log(await
|
|
22
|
-
console.log(await
|
|
23
|
-
console.log(await
|
|
22
|
+
console.log(await maptilerClient.geocoding.forward('bordeaux', {language: [maptilerClient.LanguageGeocoding.SPANISH, maptilerClient.LanguageGeocoding.ENGLISH]}));
|
|
23
|
+
console.log(await maptilerClient.geocoding.forward('bordeaux'));
|
|
24
|
+
console.log(await maptilerClient.geocoding.reverse([6.249638, 46.402056], {language: ['es', 'en']}));
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
async function testGeolocation() {
|
|
27
|
-
console.log(await
|
|
28
|
+
console.log(await maptilerClient.geolocation.info());
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
async function testCoordinates() {
|
|
31
32
|
// searching
|
|
32
|
-
console.log(await
|
|
33
|
-
console.log(await
|
|
34
|
-
console.log(await
|
|
35
|
-
console.log(await
|
|
36
|
-
console.log(await
|
|
33
|
+
console.log(await maptilerClient.coordinates.search('mercator', {transformations: true}));
|
|
34
|
+
console.log(await maptilerClient.coordinates.search('plate carree'));
|
|
35
|
+
console.log(await maptilerClient.coordinates.search('france'));
|
|
36
|
+
console.log(await maptilerClient.coordinates.search('4326', {transformations: true}));
|
|
37
|
+
console.log(await maptilerClient.coordinates.search('4326'));
|
|
37
38
|
|
|
38
39
|
// // Transforming from wgs84 (default) to lambert93
|
|
39
|
-
console.log(await
|
|
40
|
-
console.log(await
|
|
40
|
+
console.log(await maptilerClient.coordinates.transform([1, 45], {targetCrs: 9793}));
|
|
41
|
+
console.log(await maptilerClient.coordinates.transform([[10, 48], [1, 45]], {targetCrs: 9793}));
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
async function testData() {
|
|
44
|
-
console.log(await
|
|
45
|
+
console.log(await maptilerClient.data.get('2dd5ecc4-3ae1-4d1e-99a2-182256486357'));
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
function addImage(url) {
|
|
@@ -51,7 +52,7 @@
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
function staticMapTest() {
|
|
54
|
-
const imageLinkCentered =
|
|
55
|
+
const imageLinkCentered = maptilerClient.staticMaps.centered([7, 46.8], 5, {
|
|
55
56
|
hiDPI: true,
|
|
56
57
|
width: 1000,
|
|
57
58
|
height: 500,
|
|
@@ -62,11 +63,11 @@
|
|
|
62
63
|
|
|
63
64
|
addImage(imageLinkCentered);
|
|
64
65
|
|
|
65
|
-
const imageLinkBounded =
|
|
66
|
+
const imageLinkBounded = maptilerClient.staticMaps.bounded([-9.8905, 36.6274, -6.0453, 42.3208], {
|
|
66
67
|
hiDPI: true,
|
|
67
68
|
width: 1024,
|
|
68
69
|
height: 2048,
|
|
69
|
-
style:
|
|
70
|
+
style: maptilerClient.MapStyle.STAGE.DARK,
|
|
70
71
|
path: [[-9.8905, 36.6274], [-9.8905, 42.3208], [-6.0453, 42.3208], [-6.0453, 36.6274], [-9.8905, 36.6274]],
|
|
71
72
|
pathStrokeColor: 'red',
|
|
72
73
|
pathWidth: 4,
|
package/package.json
CHANGED
package/rollup.config.js
CHANGED
|
@@ -62,7 +62,7 @@ const bundles = [
|
|
|
62
62
|
],
|
|
63
63
|
output: [
|
|
64
64
|
{
|
|
65
|
-
name: "
|
|
65
|
+
name: "maptilerClient",
|
|
66
66
|
file: `dist/${name}.umd.js`,
|
|
67
67
|
format: "umd",
|
|
68
68
|
sourcemap: true
|
|
@@ -121,7 +121,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
121
121
|
],
|
|
122
122
|
output: [
|
|
123
123
|
{
|
|
124
|
-
name: "
|
|
124
|
+
name: "maptilerClient",
|
|
125
125
|
file: `dist/${name}.umd.min.js`,
|
|
126
126
|
format: "umd",
|
|
127
127
|
sourcemap: false
|