@maptiler/client 1.1.1 → 1.1.3
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.cjs +5 -5
- package/dist/maptiler-client.cjs.map +1 -1
- package/dist/maptiler-client.d.ts +1 -1
- package/dist/maptiler-client.min.mjs +1 -1
- package/dist/maptiler-client.mjs +5 -5
- package/dist/maptiler-client.mjs.map +1 -1
- package/dist/maptiler-client.umd.js +6 -6
- package/dist/maptiler-client.umd.js.map +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 +7 -7
- 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 +41 -41
- 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 +18 -17
- package/package.json +1 -1
- package/readme.md +3 -3
- package/rollup.config.js +2 -2
- package/src/mapstyle.ts +6 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[MapTiler Client - v1.1.
|
|
1
|
+
[MapTiler Client - v1.1.3](../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/ba8c80a/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/ba8c80a/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/ba8c80a/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/ba8c80a/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/ba8c80a/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/ba8c80a/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/ba8c80a/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/ba8c80a/src/mapstyle.ts#L222)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[MapTiler Client - v1.1.
|
|
1
|
+
[MapTiler Client - v1.1.3](../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/ba8c80a/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/ba8c80a/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]}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<body>
|
|
7
7
|
<p>
|
|
8
|
-
This demo is using the UMD bundle.
|
|
8
|
+
This demo is using the UMD bundle. Add <code>?key=YOUR_API_KEY</code> to the URL.
|
|
9
9
|
</p>
|
|
10
10
|
<p>
|
|
11
11
|
Open JS console.
|
|
@@ -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.DATAVIZ.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/readme.md
CHANGED
|
@@ -205,9 +205,9 @@ In the following static map functions, the `option` object features a `style` pr
|
|
|
205
205
|
- `MapStyle.TONER.LITE` (variant)
|
|
206
206
|
- `MapStyle.TONER.LINES` (variant)
|
|
207
207
|
- `MapStyle.OPENSTREETMAP` (reference style, this one does not have any variants)
|
|
208
|
-
- `MapStyle.
|
|
209
|
-
- `MapStyle.
|
|
210
|
-
- `MapStyle.
|
|
208
|
+
- `MapStyle.DATAVIZ`, the perfect style for data visualization, with very little noise
|
|
209
|
+
- `MapStyle.DATAVIZ.DARK` (variant)
|
|
210
|
+
- `MapStyle.DATAVIZ.LIGHT` (variant)
|
|
211
211
|
|
|
212
212
|
### Centered static maps
|
|
213
213
|
This type of map is centered on a longitude-latitude coordinate and the zoom level must also be provided (from `0`: very zoomed out, to `22`: very zoomed in).
|
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
|
package/src/mapstyle.ts
CHANGED
|
@@ -435,7 +435,7 @@ export type MapStyleType = {
|
|
|
435
435
|
/**
|
|
436
436
|
* Minimalist style, perfect for data visualization
|
|
437
437
|
*/
|
|
438
|
-
|
|
438
|
+
DATAVIZ: ReferenceMapStyle & {
|
|
439
439
|
/**
|
|
440
440
|
* Minimalist style, perfect for data visualization
|
|
441
441
|
*/
|
|
@@ -749,26 +749,26 @@ export const mapStylePresetList: Array<MapStylePreset> = [
|
|
|
749
749
|
},
|
|
750
750
|
|
|
751
751
|
{
|
|
752
|
-
referenceStyleID: "
|
|
753
|
-
name: "
|
|
752
|
+
referenceStyleID: "DATAVIZ",
|
|
753
|
+
name: "Dataviz",
|
|
754
754
|
description: "",
|
|
755
755
|
variants: [
|
|
756
756
|
{
|
|
757
|
-
id: "
|
|
757
|
+
id: "dataviz",
|
|
758
758
|
name: "Default",
|
|
759
759
|
variantType: "DEFAULT",
|
|
760
760
|
description: "",
|
|
761
761
|
imageURL: "",
|
|
762
762
|
},
|
|
763
763
|
{
|
|
764
|
-
id: "
|
|
764
|
+
id: "dataviz-dark",
|
|
765
765
|
name: "Dark",
|
|
766
766
|
variantType: "DARK",
|
|
767
767
|
description: "",
|
|
768
768
|
imageURL: "",
|
|
769
769
|
},
|
|
770
770
|
{
|
|
771
|
-
id: "
|
|
771
|
+
id: "dataviz-light",
|
|
772
772
|
name: "Light",
|
|
773
773
|
variantType: "LIGHT",
|
|
774
774
|
description: "",
|