@maptiler/client 1.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 +6 -0
- package/LICENSE +29 -0
- package/dist/maptiler-client.cjs +692 -0
- package/dist/maptiler-client.cjs.map +1 -0
- package/dist/maptiler-client.d.ts +702 -0
- package/dist/maptiler-client.min.mjs +1 -0
- package/dist/maptiler-client.mjs +680 -0
- package/dist/maptiler-client.mjs.map +1 -0
- package/dist/maptiler-client.umd.js +698 -0
- package/dist/maptiler-client.umd.js.map +1 -0
- package/dist/maptiler-client.umd.min.js +1 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +85 -0
- package/docs/assets/main.js +54 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1257 -0
- package/docs/classes/ClientConfig.html +122 -0
- package/docs/classes/ServiceError.html +93 -0
- package/docs/images/JS-logo.svg +4 -0
- package/docs/images/TS-logo.svg +6 -0
- package/docs/images/maptiler-client-logo.afdesign +0 -0
- package/docs/images/maptiler-client-logo.svg +75 -0
- package/docs/images/maptiler-logo.svg +23 -0
- package/docs/images/screenshots/static-bounded-europe-1024.png +0 -0
- package/docs/images/screenshots/static-bounded-europe-2048.png +0 -0
- package/docs/images/screenshots/static-bounded-portugal-1024x2048.png +0 -0
- package/docs/images/screenshots/static-bounded-portugal-2048x2048.png +0 -0
- package/docs/images/screenshots/static-with-path.png +0 -0
- package/docs/index.html +280 -0
- package/docs/modules.html +119 -0
- package/docs/types/AutomaticStaticMapOptions.html +80 -0
- package/docs/types/BoundedStaticMapOptions.html +80 -0
- package/docs/types/CenteredStaticMapOptions.html +80 -0
- package/docs/types/CoordinateExport.html +85 -0
- package/docs/types/CoordinateGrid.html +83 -0
- package/docs/types/CoordinateId.html +85 -0
- package/docs/types/CoordinateSearch.html +107 -0
- package/docs/types/CoordinateSearchResult.html +89 -0
- package/docs/types/CoordinateTransformResult.html +90 -0
- package/docs/types/CoordinateTransformation.html +103 -0
- package/docs/types/Coordinates.html +78 -0
- package/docs/types/CoordinatesSearchOptions.html +97 -0
- package/docs/types/CoordinatesTransformOptions.html +99 -0
- package/docs/types/FeatureHierarchy.html +89 -0
- package/docs/types/FetchFunction.html +93 -0
- package/docs/types/GeocodingFeature.html +78 -0
- package/docs/types/GeocodingOptions.html +97 -0
- package/docs/types/GeocodingSearchResult.html +95 -0
- package/docs/types/GeolocationInfoOptions.html +87 -0
- package/docs/types/GeolocationResult.html +150 -0
- package/docs/types/GetDataOptions.html +87 -0
- package/docs/types/LanguageGeocodingString.html +80 -0
- package/docs/types/ReverseGeocodingOptions.html +89 -0
- package/docs/types/StaticMapBaseOptions.html +176 -0
- package/docs/types/StaticMapMarker.html +80 -0
- package/docs/types/XYZ.html +87 -0
- package/docs/variables/LanguageGeocoding.html +193 -0
- package/docs/variables/config.html +80 -0
- package/docs/variables/coordinates-1.html +124 -0
- package/docs/variables/data.html +103 -0
- package/docs/variables/geocoding.html +239 -0
- package/docs/variables/geolocation.html +101 -0
- package/docs/variables/staticMaps.html +147 -0
- package/docsmd/.nojekyll +1 -0
- package/docsmd/README.md +756 -0
- package/docsmd/classes/ClientConfig.md +90 -0
- package/docsmd/classes/ServiceError.md +52 -0
- package/docsmd/images/JS-logo.svg +4 -0
- package/docsmd/images/TS-logo.svg +6 -0
- package/docsmd/images/maptiler-client-logo.afdesign +0 -0
- package/docsmd/images/maptiler-client-logo.svg +75 -0
- package/docsmd/images/maptiler-logo.svg +23 -0
- package/docsmd/images/screenshots/static-bounded-europe-1024.png +0 -0
- package/docsmd/images/screenshots/static-bounded-europe-2048.png +0 -0
- package/docsmd/images/screenshots/static-bounded-portugal-1024x2048.png +0 -0
- package/docsmd/images/screenshots/static-bounded-portugal-2048x2048.png +0 -0
- package/docsmd/images/screenshots/static-with-path.png +0 -0
- package/examples/test-browser-es.html +102 -0
- package/examples/test-browser-umd.html +89 -0
- package/examples/test-node.js +52 -0
- package/images/JS-logo.svg +4 -0
- package/images/TS-logo.svg +6 -0
- package/images/maptiler-client-logo.afdesign +0 -0
- package/images/maptiler-client-logo.svg +75 -0
- package/images/maptiler-logo.svg +23 -0
- package/images/screenshots/static-bounded-europe-1024.png +0 -0
- package/images/screenshots/static-bounded-europe-2048.png +0 -0
- package/images/screenshots/static-bounded-portugal-1024x2048.png +0 -0
- package/images/screenshots/static-bounded-portugal-2048x2048.png +0 -0
- package/images/screenshots/static-with-path.png +0 -0
- package/package.json +69 -0
- package/readme.md +287 -0
- package/rollup.config.js +142 -0
- package/src/callFetch.ts +18 -0
- package/src/config.ts +65 -0
- package/src/defaults.ts +11 -0
- package/src/index.ts +90 -0
- package/src/language.ts +87 -0
- package/src/services/ServiceError.ts +10 -0
- package/src/services/coordinates.ts +258 -0
- package/src/services/data.ts +63 -0
- package/src/services/geocoding.ts +239 -0
- package/src/services/geolocation.ts +139 -0
- package/src/services/simplify.ts +87 -0
- package/src/services/staticMaps.ts +462 -0
- package/tsconfig.json +10 -0
- package/typedoc.json +10 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
[MapTiler Client JS](../README.md) / ClientConfig
|
|
2
|
+
|
|
3
|
+
# Class: ClientConfig
|
|
4
|
+
|
|
5
|
+
The configuration object definition
|
|
6
|
+
|
|
7
|
+
## Table of contents
|
|
8
|
+
|
|
9
|
+
### Constructors
|
|
10
|
+
|
|
11
|
+
- [constructor](ClientConfig.md#constructor)
|
|
12
|
+
|
|
13
|
+
### Accessors
|
|
14
|
+
|
|
15
|
+
- [apiKey](ClientConfig.md#apikey)
|
|
16
|
+
- [fetch](ClientConfig.md#fetch)
|
|
17
|
+
|
|
18
|
+
## Constructors
|
|
19
|
+
|
|
20
|
+
### constructor
|
|
21
|
+
|
|
22
|
+
• **new ClientConfig**()
|
|
23
|
+
|
|
24
|
+
## Accessors
|
|
25
|
+
|
|
26
|
+
### apiKey
|
|
27
|
+
|
|
28
|
+
• `get` **apiKey**(): `string`
|
|
29
|
+
|
|
30
|
+
Get the MapTiler Cloud API key
|
|
31
|
+
|
|
32
|
+
#### Returns
|
|
33
|
+
|
|
34
|
+
`string`
|
|
35
|
+
|
|
36
|
+
#### Defined in
|
|
37
|
+
|
|
38
|
+
[config.ts:41](https://github.com/maptiler/maptiler-client-js/blob/3a42869/src/config.ts#L41)
|
|
39
|
+
|
|
40
|
+
• `set` **apiKey**(`k`): `void`
|
|
41
|
+
|
|
42
|
+
Set the MapTiler Cloud API key
|
|
43
|
+
|
|
44
|
+
#### Parameters
|
|
45
|
+
|
|
46
|
+
| Name | Type |
|
|
47
|
+
| :------ | :------ |
|
|
48
|
+
| `k` | `string` |
|
|
49
|
+
|
|
50
|
+
#### Returns
|
|
51
|
+
|
|
52
|
+
`void`
|
|
53
|
+
|
|
54
|
+
#### Defined in
|
|
55
|
+
|
|
56
|
+
[config.ts:34](https://github.com/maptiler/maptiler-client-js/blob/3a42869/src/config.ts#L34)
|
|
57
|
+
|
|
58
|
+
___
|
|
59
|
+
|
|
60
|
+
### fetch
|
|
61
|
+
|
|
62
|
+
• `get` **fetch**(): [`FetchFunction`](../README.md#fetchfunction)
|
|
63
|
+
|
|
64
|
+
Get the fetch fucntion
|
|
65
|
+
|
|
66
|
+
#### Returns
|
|
67
|
+
|
|
68
|
+
[`FetchFunction`](../README.md#fetchfunction)
|
|
69
|
+
|
|
70
|
+
#### Defined in
|
|
71
|
+
|
|
72
|
+
[config.ts:55](https://github.com/maptiler/maptiler-client-js/blob/3a42869/src/config.ts#L55)
|
|
73
|
+
|
|
74
|
+
• `set` **fetch**(`f`): `void`
|
|
75
|
+
|
|
76
|
+
Set a the custom fetch function to replace the default one
|
|
77
|
+
|
|
78
|
+
#### Parameters
|
|
79
|
+
|
|
80
|
+
| Name | Type |
|
|
81
|
+
| :------ | :------ |
|
|
82
|
+
| `f` | [`FetchFunction`](../README.md#fetchfunction) |
|
|
83
|
+
|
|
84
|
+
#### Returns
|
|
85
|
+
|
|
86
|
+
`void`
|
|
87
|
+
|
|
88
|
+
#### Defined in
|
|
89
|
+
|
|
90
|
+
[config.ts:48](https://github.com/maptiler/maptiler-client-js/blob/3a42869/src/config.ts#L48)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[MapTiler Client JS](../README.md) / ServiceError
|
|
2
|
+
|
|
3
|
+
# Class: ServiceError
|
|
4
|
+
|
|
5
|
+
A ServiceError is an Error that includes the HTTP response details
|
|
6
|
+
|
|
7
|
+
## Hierarchy
|
|
8
|
+
|
|
9
|
+
- `Error`
|
|
10
|
+
|
|
11
|
+
↳ **`ServiceError`**
|
|
12
|
+
|
|
13
|
+
## Table of contents
|
|
14
|
+
|
|
15
|
+
### Constructors
|
|
16
|
+
|
|
17
|
+
- [constructor](ServiceError.md#constructor)
|
|
18
|
+
|
|
19
|
+
### Properties
|
|
20
|
+
|
|
21
|
+
- [res](ServiceError.md#res)
|
|
22
|
+
|
|
23
|
+
## Constructors
|
|
24
|
+
|
|
25
|
+
### constructor
|
|
26
|
+
|
|
27
|
+
• **new ServiceError**(`res`, `customMessage?`)
|
|
28
|
+
|
|
29
|
+
#### Parameters
|
|
30
|
+
|
|
31
|
+
| Name | Type | Default value |
|
|
32
|
+
| :------ | :------ | :------ |
|
|
33
|
+
| `res` | `Response` | `undefined` |
|
|
34
|
+
| `customMessage` | `string` | `""` |
|
|
35
|
+
|
|
36
|
+
#### Overrides
|
|
37
|
+
|
|
38
|
+
Error.constructor
|
|
39
|
+
|
|
40
|
+
#### Defined in
|
|
41
|
+
|
|
42
|
+
[services/ServiceError.ts:5](https://github.com/maptiler/maptiler-client-js/blob/3a42869/src/services/ServiceError.ts#L5)
|
|
43
|
+
|
|
44
|
+
## Properties
|
|
45
|
+
|
|
46
|
+
### res
|
|
47
|
+
|
|
48
|
+
• **res**: `Response`
|
|
49
|
+
|
|
50
|
+
#### Defined in
|
|
51
|
+
|
|
52
|
+
[services/ServiceError.ts:5](https://github.com/maptiler/maptiler-client-js/blob/3a42869/src/services/ServiceError.ts#L5)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 630 630">
|
|
2
|
+
<rect width="630" height="630" fill="#f7df1e"/>
|
|
3
|
+
<path d="m423.2 492.19c12.69 20.72 29.2 35.95 58.4 35.95 24.53 0 40.2-12.26 40.2-29.2 0-20.3-16.1-27.49-43.1-39.3l-14.8-6.35c-42.72-18.2-71.1-41-71.1-89.2 0-44.4 33.83-78.2 86.7-78.2 37.64 0 64.7 13.1 84.2 47.4l-46.1 29.6c-10.15-18.2-21.1-25.37-38.1-25.37-17.34 0-28.33 11-28.33 25.37 0 17.76 11 24.95 36.4 35.95l14.8 6.34c50.3 21.57 78.7 43.56 78.7 93 0 53.3-41.87 82.5-98.1 82.5-54.98 0-90.5-26.2-107.88-60.54zm-209.13 5.13c9.3 16.5 17.76 30.45 38.1 30.45 19.45 0 31.72-7.61 31.72-37.2v-201.3h59.2v202.1c0 61.3-35.94 89.2-88.4 89.2-47.4 0-74.85-24.53-88.81-54.075z"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="512" height="512" fill="none" version="1.1" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
|
3
|
+
<title>TypeScript logo</title>
|
|
4
|
+
<rect width="512" height="512" rx="0" fill="#3178c6"/>
|
|
5
|
+
<path d="m317 407v50c8.1 4.2 18 7.3 29 9.4s23 3.1 35 3.1c12 0 23-1.1 34-3.4 11-2.3 20-6.1 28-11 8.1-5.3 15-12 19-21s7.1-19 7.1-32c0-9.1-1.4-17-4.1-24s-6.6-13-12-18c-5.1-5.3-11-10-18-14s-15-8.2-24-12c-6.6-2.7-12-5.3-18-7.9-5.2-2.6-9.7-5.2-13-7.8-3.7-2.7-6.5-5.5-8.5-8.4-2-3-3-6.3-3-10 0-3.4 0.89-6.5 2.7-9.3s4.3-5.1 7.5-7.1c3.2-2 7.2-3.5 12-4.6 4.7-1.1 9.9-1.6 16-1.6 4.2 0 8.6 0.31 13 0.94 4.6 0.63 9.3 1.6 14 2.9 4.7 1.3 9.3 2.9 14 4.9 4.4 2 8.5 4.3 12 6.9v-47c-7.6-2.9-16-5.1-25-6.5s-19-2.1-31-2.1c-12 0-23 1.3-34 3.8s-20 6.5-28 12c-8.1 5.4-14 12-19 21-4.7 8.4-7 18-7 30 0 15 4.3 28 13 38 8.6 11 22 19 39 27 6.9 2.8 13 5.6 19 8.3s11 5.5 15 8.4c4.3 2.9 7.7 6.1 10 9.5 2.5 3.4 3.8 7.4 3.8 12 0 3.2-0.78 6.2-2.3 9s-3.9 5.2-7.1 7.2-7.1 3.6-12 4.8c-4.7 1.1-10 1.7-17 1.7-11 0-22-1.9-32-5.7-11-3.8-21-9.5-30-17zm-84-123h64v-41h-179v41h64v183h51z" clip-rule="evenodd" fill="#fff" fill-rule="evenodd" style="fill:#fff"/>
|
|
6
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg width="100%" height="100%" viewBox="0 0 231 41" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
|
4
|
+
<g transform="matrix(1,0,0,1,-9.41979e-05,0.000178727)">
|
|
5
|
+
<g transform="matrix(1,0,0,1,-1.20801,-0.711928)">
|
|
6
|
+
<path d="M58.567,28.139L58.567,20.497C58.567,18.616 57.566,16.908 55.595,16.908C53.654,16.908 52.508,18.616 52.508,20.497L52.508,28.139L48.922,28.139L48.922,13.84L52.244,13.84L52.508,15.578C53.273,14.129 54.949,13.609 56.33,13.609C58.066,13.609 59.8,14.304 60.624,16.271C61.918,14.245 63.595,13.667 65.476,13.667C69.593,13.667 71.622,16.155 71.622,20.44L71.622,28.139L68.034,28.139L68.034,20.44C68.034,18.559 67.24,16.966 65.301,16.966C63.359,16.966 62.153,18.616 62.153,20.497L62.153,28.139L58.567,28.139Z" style="fill:rgb(51,51,89);fill-rule:nonzero;"/>
|
|
7
|
+
<path d="M86.765,13.87L90.206,13.87L90.206,28.139L86.824,28.139L86.647,26.056C85.825,27.734 83.561,28.543 81.943,28.573C77.651,28.603 74.474,25.997 74.474,20.989C74.474,16.069 77.798,13.493 82.033,13.522C83.973,13.522 85.824,14.419 86.647,15.838L86.765,13.87ZM78.062,20.989C78.062,23.71 79.973,25.331 82.355,25.331C88,25.331 88,16.677 82.355,16.677C79.973,16.677 78.062,18.269 78.062,20.989Z" style="fill:rgb(51,51,89);fill-rule:nonzero;"/>
|
|
8
|
+
<path d="M93.236,34.105L93.236,13.87L96.589,13.87L96.822,15.838C97.94,14.245 99.882,13.551 101.528,13.551C105.996,13.551 108.968,16.822 108.968,21.019C108.968,25.187 106.291,28.487 101.645,28.487C100.118,28.487 97.852,28.023 96.822,26.461L96.822,34.104L93.236,34.104L93.236,34.105ZM105.381,21.019C105.381,18.791 103.851,16.966 101.264,16.966C98.676,16.966 97.146,18.791 97.146,21.019C97.146,23.247 98.823,25.073 101.264,25.073C103.705,25.073 105.381,23.247 105.381,21.019Z" style="fill:rgb(51,51,89);fill-rule:nonzero;"/>
|
|
9
|
+
<path d="M115.378,9.528L115.378,13.84L120.319,13.84L120.319,15.026L115.378,15.026L115.378,23.739C115.378,25.679 115.791,27.04 118.055,27.04C118.76,27.04 119.554,26.808 120.289,26.461L120.789,27.617C119.877,28.054 118.965,28.342 118.055,28.342C114.968,28.342 113.967,26.547 113.967,23.74L113.967,15.027L110.879,15.027L110.879,13.84L113.967,13.84L113.967,9.672L115.378,9.528Z" style="fill:rgb(51,51,89);fill-rule:nonzero;"/>
|
|
10
|
+
<path d="M125.554,9.18C125.554,10.685 123.23,10.685 123.23,9.18C123.23,7.675 125.554,7.675 125.554,9.18ZM123.643,13.782L123.643,28.14L125.082,28.14L125.082,13.782L123.643,13.782Z" style="fill:rgb(51,51,89);fill-rule:nonzero;"/>
|
|
11
|
+
<rect x="129.199" y="7.878" width="1.441" height="20.261" style="fill:rgb(51,51,89);"/>
|
|
12
|
+
<path d="M153.488,13.84L153.547,16.389C154.459,14.448 156.518,13.696 158.37,13.696C159.459,13.667 160.515,13.956 161.486,14.536L160.839,15.693C160.076,15.23 159.221,15.027 158.37,15.027C155.663,15.057 153.576,17.198 153.576,19.804L153.576,28.14L152.135,28.14L152.135,13.84L153.488,13.84Z" style="fill:rgb(51,51,89);fill-rule:nonzero;"/>
|
|
13
|
+
<path d="M135.54,23.414C135.541,23.415 135.543,23.417 135.543,23.418L147.303,20.354C147.302,20.349 147.302,20.345 147.302,20.341L135.54,23.414Z" style="fill:rgb(51,51,89);fill-rule:nonzero;"/>
|
|
14
|
+
<path d="M141.214,27.28C138.654,27.28 136.461,25.701 135.543,23.458L135.535,23.458L135.542,23.457C135.542,23.456 135.541,23.455 135.54,23.454L147.301,20.38C147.301,20.385 147.302,20.389 147.302,20.394L148.555,20.068C148.049,16.446 144.956,13.658 141.214,13.658C137.12,13.658 133.802,16.996 133.802,21.113C133.802,25.23 137.12,28.569 141.214,28.569C144.276,28.569 146.905,26.7 148.035,24.037L146.855,23.532C145.921,25.734 143.747,27.28 141.214,27.28ZM135.083,21.113C135.083,17.708 137.828,14.946 141.214,14.946C143.862,14.946 146.117,16.634 146.976,18.999L135.16,22.085C135.11,21.768 135.083,21.444 135.083,21.113Z" style="fill:rgb(51,51,89);fill-rule:nonzero;"/>
|
|
15
|
+
</g>
|
|
16
|
+
<g transform="matrix(1,0,0,1,-1.20801,-0.711928)">
|
|
17
|
+
<path d="M11.965,33.743C14.023,35.769 19.5,41.264 19.497,41.269C19.477,41.305 24.938,35.908 27.113,33.768L19.526,26.3L11.965,33.743Z" style="fill:rgb(58,24,136);fill-rule:nonzero;"/>
|
|
18
|
+
<path d="M19.526,26.3L27.113,33.768C27.124,33.756 27.138,33.741 27.15,33.731L34.73,26.27L27.143,18.802L19.526,26.3Z" style="fill:rgb(3,161,196);fill-rule:nonzero;"/>
|
|
19
|
+
<path d="M34.73,26.27L34.749,26.25C38.942,22.123 38.945,15.435 34.762,11.302L27.144,18.802L34.73,26.27Z" style="fill:rgb(5,208,223);fill-rule:nonzero;"/>
|
|
20
|
+
<path d="M11.908,18.802L4.349,26.243C4.351,26.245 4.352,26.248 4.355,26.25L11.953,33.73C11.957,33.734 11.961,33.738 11.966,33.743L19.526,26.3L11.908,18.802Z" style="fill:rgb(118,31,232);fill-rule:nonzero;"/>
|
|
21
|
+
<path d="M19.526,11.303L27.143,18.802L34.762,11.303C34.755,11.298 34.753,11.295 34.749,11.29L27.15,3.81C27.149,3.808 27.146,3.806 27.144,3.804L19.526,11.303Z" style="fill:rgb(255,170,1);fill-rule:nonzero;"/>
|
|
22
|
+
<path d="M4.317,11.328C0.161,15.46 0.172,22.124 4.349,26.243L11.908,18.802L4.317,11.328Z" style="fill:rgb(241,23,93);fill-rule:nonzero;"/>
|
|
23
|
+
<path d="M19.526,11.303L11.934,3.829L4.355,11.29C4.341,11.303 4.33,11.317 4.316,11.329L11.908,18.802L19.526,11.303Z" style="fill:rgb(251,58,27);fill-rule:nonzero;"/>
|
|
24
|
+
<path d="M27.144,3.804C22.946,-0.321 16.148,-0.319 11.953,3.81L11.934,3.829L19.526,11.303L27.144,3.804Z" style="fill:rgb(251,201,53);fill-rule:nonzero;"/>
|
|
25
|
+
</g>
|
|
26
|
+
<g>
|
|
27
|
+
<g transform="matrix(1.45413,0,0,1,-169.409,0.0892285)">
|
|
28
|
+
<clipPath id="_clip1">
|
|
29
|
+
<path d="M231.731,-0.54L263.099,11.149L258.296,38.404L226.928,26.715L231.731,-0.54Z"/>
|
|
30
|
+
</clipPath>
|
|
31
|
+
<g clip-path="url(#_clip1)">
|
|
32
|
+
<path d="M270.382,12.81L232.413,12.81C231.562,12.81 230.871,13.815 230.871,15.052L230.871,25.472C230.871,26.692 231.552,27.683 232.391,27.683L270.382,27.683L270.382,12.81Z" style="fill:rgb(3,161,196);"/>
|
|
33
|
+
</g>
|
|
34
|
+
</g>
|
|
35
|
+
<g transform="matrix(0.364213,0,0,0.364213,-18.0413,0.200674)">
|
|
36
|
+
<g transform="matrix(30.2678,0,0,30.2678,514.098,66.0889)">
|
|
37
|
+
<path d="M0.558,-0.487C0.553,-0.508 0.545,-0.527 0.536,-0.544C0.527,-0.561 0.515,-0.576 0.5,-0.589C0.485,-0.602 0.468,-0.612 0.449,-0.619C0.429,-0.626 0.406,-0.629 0.38,-0.629C0.342,-0.629 0.309,-0.621 0.282,-0.606C0.254,-0.591 0.231,-0.57 0.214,-0.545C0.197,-0.519 0.184,-0.49 0.176,-0.457C0.167,-0.424 0.163,-0.391 0.163,-0.357C0.163,-0.323 0.167,-0.29 0.176,-0.257C0.184,-0.224 0.197,-0.195 0.214,-0.17C0.231,-0.144 0.254,-0.123 0.282,-0.108C0.309,-0.093 0.342,-0.085 0.38,-0.085C0.408,-0.085 0.433,-0.09 0.454,-0.1C0.475,-0.109 0.494,-0.123 0.509,-0.14C0.524,-0.157 0.536,-0.176 0.545,-0.199C0.554,-0.222 0.559,-0.246 0.562,-0.272L0.684,-0.272C0.681,-0.229 0.672,-0.19 0.657,-0.155C0.641,-0.12 0.62,-0.089 0.593,-0.064C0.566,-0.038 0.535,-0.018 0.499,-0.004C0.463,0.01 0.423,0.017 0.38,0.017C0.327,0.017 0.279,0.007 0.237,-0.013C0.194,-0.032 0.158,-0.059 0.129,-0.093C0.1,-0.127 0.077,-0.167 0.062,-0.212C0.046,-0.257 0.038,-0.306 0.038,-0.357C0.038,-0.408 0.046,-0.456 0.062,-0.501C0.077,-0.546 0.1,-0.586 0.129,-0.62C0.158,-0.654 0.194,-0.681 0.237,-0.701C0.279,-0.721 0.327,-0.731 0.38,-0.731C0.42,-0.731 0.458,-0.725 0.493,-0.715C0.528,-0.704 0.56,-0.688 0.587,-0.667C0.614,-0.646 0.635,-0.62 0.652,-0.59C0.669,-0.56 0.679,-0.526 0.683,-0.487L0.558,-0.487Z" style="fill:white;fill-rule:nonzero;"/>
|
|
38
|
+
</g>
|
|
39
|
+
<g transform="matrix(30.2678,0,0,30.2678,535.951,66.0889)">
|
|
40
|
+
<path d="M0.076,-0.714L0.201,-0.714L0.201,-0.108L0.564,-0.108L0.564,-0L0.076,-0L0.076,-0.714Z" style="fill:white;fill-rule:nonzero;"/>
|
|
41
|
+
</g>
|
|
42
|
+
<g transform="matrix(30.2678,0,0,30.2678,553.325,66.0889)">
|
|
43
|
+
<rect x="0.076" y="-0.714" width="0.125" height="0.714" style="fill:white;fill-rule:nonzero;"/>
|
|
44
|
+
</g>
|
|
45
|
+
<g transform="matrix(30.2678,0,0,30.2678,561.74,66.0889)">
|
|
46
|
+
<path d="M0.076,-0.714L0.59,-0.714L0.59,-0.606L0.201,-0.606L0.201,-0.419L0.561,-0.419L0.561,-0.317L0.201,-0.317L0.201,-0.108L0.597,-0.108L0.597,-0L0.076,-0L0.076,-0.714Z" style="fill:white;fill-rule:nonzero;"/>
|
|
47
|
+
</g>
|
|
48
|
+
<g transform="matrix(30.2678,0,0,30.2678,580.808,66.0889)">
|
|
49
|
+
<path d="M0.071,-0.714L0.203,-0.714L0.529,-0.188L0.531,-0.188L0.531,-0.714L0.65,-0.714L0.65,-0L0.518,-0L0.193,-0.525L0.19,-0.525L0.19,-0L0.071,-0L0.071,-0.714Z" style="fill:white;fill-rule:nonzero;"/>
|
|
50
|
+
</g>
|
|
51
|
+
<g transform="matrix(30.2678,0,0,30.2678,602.662,66.0889)">
|
|
52
|
+
<path d="M0.008,-0.714L0.586,-0.714L0.586,-0.606L0.359,-0.606L0.359,-0L0.234,-0L0.234,-0.606L0.008,-0.606L0.008,-0.714Z" style="fill:white;fill-rule:nonzero;"/>
|
|
53
|
+
</g>
|
|
54
|
+
</g>
|
|
55
|
+
</g>
|
|
56
|
+
<g transform="matrix(1,0,0,1,-4.85769,0)">
|
|
57
|
+
<g transform="matrix(-1.1073,-1.35605e-16,1.40521e-16,-1.14744,491.39,43.567)">
|
|
58
|
+
<clipPath id="_clip2">
|
|
59
|
+
<path d="M222.883,26.693L244.255,31.978L249.737,11.334L228.365,6.049L222.883,26.693Z"/>
|
|
60
|
+
</clipPath>
|
|
61
|
+
<g clip-path="url(#_clip2)">
|
|
62
|
+
<path d="M270.382,12.81L233.848,12.81C232.205,12.81 230.871,14.097 230.871,15.683L230.871,24.808C230.871,26.395 232.206,27.683 233.85,27.683L270.382,27.683L270.382,12.81Z" style="fill:rgb(251,201,53);"/>
|
|
63
|
+
</g>
|
|
64
|
+
</g>
|
|
65
|
+
<g transform="matrix(0.364213,0,0,0.364213,32.4999,0.200674)">
|
|
66
|
+
<g transform="matrix(30.2678,0,0,30.2678,514.098,66.0889)">
|
|
67
|
+
<path d="M0.461,-0.23C0.461,-0.199 0.458,-0.168 0.453,-0.139C0.448,-0.11 0.437,-0.083 0.421,-0.06C0.404,-0.037 0.381,-0.018 0.35,-0.004C0.319,0.01 0.277,0.017 0.226,0.017C0.188,0.017 0.156,0.011 0.129,-0.001C0.102,-0.012 0.08,-0.028 0.063,-0.049C0.046,-0.069 0.033,-0.093 0.025,-0.121C0.017,-0.149 0.013,-0.179 0.013,-0.212L0.013,-0.25L0.138,-0.25L0.138,-0.213C0.138,-0.172 0.145,-0.141 0.159,-0.119C0.172,-0.096 0.198,-0.085 0.236,-0.085C0.256,-0.085 0.273,-0.088 0.286,-0.094C0.299,-0.1 0.309,-0.109 0.317,-0.121C0.324,-0.132 0.329,-0.147 0.332,-0.164C0.335,-0.181 0.336,-0.201 0.336,-0.223L0.336,-0.714L0.461,-0.714L0.461,-0.23Z" style="fill:white;fill-rule:nonzero;"/>
|
|
68
|
+
</g>
|
|
69
|
+
<g transform="matrix(30.2678,0,0,30.2678,530.352,66.0889)">
|
|
70
|
+
<path d="M0.158,-0.238C0.158,-0.211 0.163,-0.187 0.172,-0.168C0.181,-0.149 0.194,-0.133 0.211,-0.121C0.228,-0.108 0.247,-0.099 0.269,-0.094C0.29,-0.088 0.314,-0.085 0.339,-0.085C0.366,-0.085 0.39,-0.088 0.409,-0.095C0.428,-0.101 0.444,-0.109 0.456,-0.119C0.468,-0.129 0.477,-0.14 0.482,-0.154C0.487,-0.167 0.49,-0.18 0.49,-0.193C0.49,-0.22 0.484,-0.241 0.472,-0.254C0.459,-0.267 0.446,-0.276 0.431,-0.281C0.406,-0.29 0.376,-0.299 0.343,-0.308C0.309,-0.316 0.267,-0.327 0.218,-0.34C0.187,-0.348 0.162,-0.359 0.142,-0.372C0.121,-0.385 0.105,-0.399 0.093,-0.415C0.081,-0.431 0.073,-0.448 0.068,-0.466C0.063,-0.484 0.06,-0.502 0.06,-0.521C0.06,-0.557 0.068,-0.588 0.083,-0.615C0.097,-0.641 0.117,-0.663 0.142,-0.68C0.167,-0.697 0.195,-0.71 0.226,-0.719C0.257,-0.727 0.289,-0.731 0.321,-0.731C0.358,-0.731 0.393,-0.726 0.427,-0.717C0.46,-0.707 0.489,-0.692 0.514,-0.673C0.539,-0.654 0.558,-0.63 0.573,-0.602C0.588,-0.573 0.595,-0.54 0.595,-0.503L0.47,-0.503C0.467,-0.549 0.451,-0.582 0.423,-0.601C0.395,-0.62 0.359,-0.629 0.316,-0.629C0.301,-0.629 0.286,-0.628 0.271,-0.625C0.256,-0.622 0.242,-0.616 0.229,-0.61C0.216,-0.603 0.206,-0.593 0.198,-0.581C0.189,-0.569 0.185,-0.554 0.185,-0.536C0.185,-0.511 0.193,-0.491 0.209,-0.477C0.224,-0.462 0.245,-0.451 0.27,-0.444C0.273,-0.443 0.283,-0.44 0.302,-0.436C0.32,-0.431 0.34,-0.425 0.363,-0.419C0.386,-0.413 0.408,-0.407 0.43,-0.402C0.451,-0.396 0.467,-0.392 0.476,-0.389C0.499,-0.382 0.52,-0.372 0.537,-0.359C0.554,-0.346 0.569,-0.332 0.581,-0.316C0.592,-0.299 0.601,-0.282 0.607,-0.263C0.612,-0.244 0.615,-0.226 0.615,-0.207C0.615,-0.167 0.607,-0.133 0.591,-0.105C0.574,-0.076 0.553,-0.053 0.526,-0.035C0.499,-0.017 0.469,-0.004 0.435,0.005C0.401,0.013 0.366,0.017 0.331,0.017C0.29,0.017 0.252,0.012 0.216,0.002C0.18,-0.008 0.149,-0.023 0.122,-0.044C0.095,-0.065 0.074,-0.091 0.058,-0.124C0.042,-0.156 0.034,-0.194 0.033,-0.238L0.158,-0.238Z" style="fill:white;fill-rule:nonzero;"/>
|
|
71
|
+
</g>
|
|
72
|
+
</g>
|
|
73
|
+
</g>
|
|
74
|
+
</g>
|
|
75
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg width="100%" height="100%" viewBox="0 0 161 41" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
|
4
|
+
<g transform="matrix(1,0,0,1,-1.20801,-0.711928)">
|
|
5
|
+
<path d="M11.965,33.743C14.023,35.769 19.5,41.264 19.497,41.269C19.477,41.305 24.938,35.908 27.113,33.768L19.526,26.3L11.965,33.743Z" style="fill:rgb(58,24,136);fill-rule:nonzero;"/>
|
|
6
|
+
<path d="M19.526,26.3L27.113,33.768C27.124,33.756 27.138,33.741 27.15,33.731L34.73,26.27L27.143,18.802L19.526,26.3Z" style="fill:rgb(3,161,196);fill-rule:nonzero;"/>
|
|
7
|
+
<path d="M34.73,26.27L34.749,26.25C38.942,22.123 38.945,15.435 34.762,11.302L27.144,18.802L34.73,26.27Z" style="fill:rgb(5,208,223);fill-rule:nonzero;"/>
|
|
8
|
+
<path d="M11.908,18.802L4.349,26.243C4.351,26.245 4.352,26.248 4.355,26.25L11.953,33.73C11.957,33.734 11.961,33.738 11.966,33.743L19.526,26.3L11.908,18.802Z" style="fill:rgb(118,31,232);fill-rule:nonzero;"/>
|
|
9
|
+
<path d="M19.526,11.303L27.143,18.802L34.762,11.303C34.755,11.298 34.753,11.295 34.749,11.29L27.15,3.81C27.149,3.808 27.146,3.806 27.144,3.804L19.526,11.303Z" style="fill:rgb(255,170,1);fill-rule:nonzero;"/>
|
|
10
|
+
<path d="M4.317,11.328C0.161,15.46 0.172,22.124 4.349,26.243L11.908,18.802L4.317,11.328Z" style="fill:rgb(241,23,93);fill-rule:nonzero;"/>
|
|
11
|
+
<path d="M19.526,11.303L11.934,3.829L4.355,11.29C4.341,11.303 4.33,11.317 4.316,11.329L11.908,18.802L19.526,11.303Z" style="fill:rgb(251,58,27);fill-rule:nonzero;"/>
|
|
12
|
+
<path d="M27.144,3.804C22.946,-0.321 16.148,-0.319 11.953,3.81L11.934,3.829L19.526,11.303L27.144,3.804Z" style="fill:rgb(251,201,53);fill-rule:nonzero;"/>
|
|
13
|
+
<path d="M58.567,28.139L58.567,20.497C58.567,18.616 57.566,16.908 55.595,16.908C53.654,16.908 52.508,18.616 52.508,20.497L52.508,28.139L48.922,28.139L48.922,13.84L52.244,13.84L52.508,15.578C53.273,14.129 54.949,13.609 56.33,13.609C58.066,13.609 59.8,14.304 60.624,16.271C61.918,14.245 63.595,13.667 65.476,13.667C69.593,13.667 71.622,16.155 71.622,20.44L71.622,28.139L68.034,28.139L68.034,20.44C68.034,18.559 67.24,16.966 65.301,16.966C63.359,16.966 62.153,18.616 62.153,20.497L62.153,28.139L58.567,28.139Z" style="fill-rule:nonzero;"/>
|
|
14
|
+
<path d="M86.765,13.87L90.206,13.87L90.206,28.139L86.824,28.139L86.647,26.056C85.825,27.734 83.561,28.543 81.943,28.573C77.651,28.603 74.474,25.997 74.474,20.989C74.474,16.069 77.798,13.493 82.033,13.522C83.973,13.522 85.824,14.419 86.647,15.838L86.765,13.87ZM78.062,20.989C78.062,23.71 79.973,25.331 82.355,25.331C88,25.331 88,16.677 82.355,16.677C79.973,16.677 78.062,18.269 78.062,20.989Z" style="fill-rule:nonzero;"/>
|
|
15
|
+
<path d="M93.236,34.105L93.236,13.87L96.589,13.87L96.822,15.838C97.94,14.245 99.882,13.551 101.528,13.551C105.996,13.551 108.968,16.822 108.968,21.019C108.968,25.187 106.291,28.487 101.645,28.487C100.118,28.487 97.852,28.023 96.822,26.461L96.822,34.104L93.236,34.104L93.236,34.105ZM105.381,21.019C105.381,18.791 103.851,16.966 101.264,16.966C98.676,16.966 97.146,18.791 97.146,21.019C97.146,23.247 98.823,25.073 101.264,25.073C103.705,25.073 105.381,23.247 105.381,21.019Z" style="fill-rule:nonzero;"/>
|
|
16
|
+
<path d="M115.378,9.528L115.378,13.84L120.319,13.84L120.319,15.026L115.378,15.026L115.378,23.739C115.378,25.679 115.791,27.04 118.055,27.04C118.76,27.04 119.554,26.808 120.289,26.461L120.789,27.617C119.877,28.054 118.965,28.342 118.055,28.342C114.968,28.342 113.967,26.547 113.967,23.74L113.967,15.027L110.879,15.027L110.879,13.84L113.967,13.84L113.967,9.672L115.378,9.528Z" style="fill-rule:nonzero;"/>
|
|
17
|
+
<path d="M125.554,9.18C125.554,10.685 123.23,10.685 123.23,9.18C123.23,7.675 125.554,7.675 125.554,9.18ZM123.643,13.782L123.643,28.14L125.082,28.14L125.082,13.782L123.643,13.782Z" style="fill-rule:nonzero;"/>
|
|
18
|
+
<rect x="129.199" y="7.878" width="1.441" height="20.261" style="fill-rule:nonzero;"/>
|
|
19
|
+
<path d="M153.488,13.84L153.547,16.389C154.459,14.448 156.518,13.696 158.37,13.696C159.459,13.667 160.515,13.956 161.486,14.536L160.839,15.693C160.076,15.23 159.221,15.027 158.37,15.027C155.663,15.057 153.576,17.198 153.576,19.804L153.576,28.14L152.135,28.14L152.135,13.84L153.488,13.84Z" style="fill-rule:nonzero;"/>
|
|
20
|
+
<path d="M135.54,23.414C135.541,23.415 135.543,23.417 135.543,23.418L147.303,20.354C147.302,20.349 147.302,20.345 147.302,20.341L135.54,23.414Z" style="fill-rule:nonzero;"/>
|
|
21
|
+
<path d="M141.214,27.28C138.654,27.28 136.461,25.701 135.543,23.458L135.535,23.458L135.542,23.457C135.542,23.456 135.541,23.455 135.54,23.454L147.301,20.38C147.301,20.385 147.302,20.389 147.302,20.394L148.555,20.068C148.049,16.446 144.956,13.658 141.214,13.658C137.12,13.658 133.802,16.996 133.802,21.113C133.802,25.23 137.12,28.569 141.214,28.569C144.276,28.569 146.905,26.7 148.035,24.037L146.855,23.532C145.921,25.734 143.747,27.28 141.214,27.28ZM135.083,21.113C135.083,17.708 137.828,14.946 141.214,14.946C143.862,14.946 146.117,16.634 146.976,18.999L135.16,22.085C135.11,21.768 135.083,21.444 135.083,21.113Z" style="fill-rule:nonzero;"/>
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>tslib</title>
|
|
4
|
+
</head>
|
|
5
|
+
|
|
6
|
+
<body>
|
|
7
|
+
<p>
|
|
8
|
+
This demo is using the ES module.
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
Open JS console.
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<div id="images"></div>
|
|
15
|
+
|
|
16
|
+
<script type="module">
|
|
17
|
+
import {
|
|
18
|
+
config,
|
|
19
|
+
geocoding,
|
|
20
|
+
geolocation,
|
|
21
|
+
coordinates,
|
|
22
|
+
data,
|
|
23
|
+
staticMaps,
|
|
24
|
+
LanguageGeocoding,
|
|
25
|
+
} from '../dist/maptiler-client.mjs';
|
|
26
|
+
|
|
27
|
+
console.log(LanguageGeocoding);
|
|
28
|
+
|
|
29
|
+
config.apiKey = 'YOUR_API_KEY';
|
|
30
|
+
|
|
31
|
+
async function testGeocoding() {
|
|
32
|
+
console.log(await geocoding.forward('bordeaux', {language: [geocoding.language.SPANISH, geocoding.language.ENGLISH]}));
|
|
33
|
+
console.log(await geocoding.forward('bordeaux', {
|
|
34
|
+
bbox: [-7.638157121837139, 33.595474163650685, -7.624914050102235, 33.600446760011856]
|
|
35
|
+
}));
|
|
36
|
+
console.log(await geocoding.reverse([6.249638, 46.402056], {language: ['es', 'en']}));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function testGeolocation() {
|
|
40
|
+
console.log(await geolocation.info());
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function testCoordinates() {
|
|
44
|
+
// searching
|
|
45
|
+
console.log(await coordinates.search('mercator', {transformations: true}));
|
|
46
|
+
console.log(await coordinates.search('plate carree'));
|
|
47
|
+
console.log(await coordinates.search('france'));
|
|
48
|
+
console.log(await coordinates.search('4326', {transformations: true}));
|
|
49
|
+
console.log(await coordinates.search('4326'));
|
|
50
|
+
|
|
51
|
+
// Transforming from wgs84 (default) to lambert93
|
|
52
|
+
console.log(await coordinates.transform([1, 45], {targetCrs: 9793}));
|
|
53
|
+
console.log(await coordinates.transform([[10, 48], [1, 45]], {targetCrs: 9793}));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function testData() {
|
|
57
|
+
console.log(await data.get('2dd5ecc4-3ae1-4d1e-99a2-182256486357'));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function addImage(url) {
|
|
61
|
+
const img = document.createElement("img");
|
|
62
|
+
img.src = url;
|
|
63
|
+
document.getElementById("images").appendChild(img);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function staticMapTest() {
|
|
67
|
+
const imageLinkCentered = staticMaps.centered([7, 46.8], 5, {
|
|
68
|
+
hiDPI: true,
|
|
69
|
+
width: 1000,
|
|
70
|
+
height: 500,
|
|
71
|
+
style: 'winter',
|
|
72
|
+
markers: [[7, 46, 'green'], [8, 47, '#982']],
|
|
73
|
+
apiKey: "YOUR_PRO_API_KEY",
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
addImage(imageLinkCentered);
|
|
77
|
+
|
|
78
|
+
const imageLinkBounded = staticMaps.bounded([-9.8905, 36.6274, -6.0453, 42.3208], {
|
|
79
|
+
hiDPI: true,
|
|
80
|
+
width: 1024,
|
|
81
|
+
height: 2048,
|
|
82
|
+
style: 'streets-v2',
|
|
83
|
+
path: [[-9.8905, 36.6274], [-9.8905, 42.3208], [-6.0453, 42.3208], [-6.0453, 36.6274], [-9.8905, 36.6274]],
|
|
84
|
+
pathStrokeColor: 'red',
|
|
85
|
+
pathWidth: 4,
|
|
86
|
+
apiKey: "YOUR_PRO_API_KEY",
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
addImage(imageLinkBounded);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
(async () => {
|
|
94
|
+
await testGeocoding();
|
|
95
|
+
await testGeolocation();
|
|
96
|
+
await testCoordinates();
|
|
97
|
+
await testData();
|
|
98
|
+
staticMapTest();
|
|
99
|
+
})()
|
|
100
|
+
</script>
|
|
101
|
+
</body>
|
|
102
|
+
</html>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<title>tslib</title>
|
|
4
|
+
</head>
|
|
5
|
+
|
|
6
|
+
<body>
|
|
7
|
+
<p>
|
|
8
|
+
This demo is using the UMD bundle.
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
Open JS console.
|
|
12
|
+
</p>
|
|
13
|
+
<div id="images"></div>
|
|
14
|
+
|
|
15
|
+
<script src ="../dist/maptiler-client.umd.js"></script>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
maptilerclient.config.apiKey = 'YOUR_API_KEY';
|
|
19
|
+
|
|
20
|
+
async function testGeocoding() {
|
|
21
|
+
console.log(await maptilerclient.geocoding.forward('bordeaux', {language: [maptilerclient.LanguageGeocoding.SPANISH, maptilerclient.LanguageGeocoding.ENGLISH]}));
|
|
22
|
+
console.log(await maptilerclient.geocoding.forward('bordeaux'));
|
|
23
|
+
console.log(await maptilerclient.geocoding.reverse([6.249638, 46.402056], {language: ['es', 'en']}));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function testGeolocation() {
|
|
27
|
+
console.log(await maptilerclient.geolocation.info());
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function testCoordinates() {
|
|
31
|
+
// searching
|
|
32
|
+
console.log(await maptilerclient.coordinates.search('mercator', {transformations: true}));
|
|
33
|
+
console.log(await maptilerclient.coordinates.search('plate carree'));
|
|
34
|
+
console.log(await maptilerclient.coordinates.search('france'));
|
|
35
|
+
console.log(await maptilerclient.coordinates.search('4326', {transformations: true}));
|
|
36
|
+
console.log(await maptilerclient.coordinates.search('4326'));
|
|
37
|
+
|
|
38
|
+
// // Transforming from wgs84 (default) to lambert93
|
|
39
|
+
console.log(await maptilerclient.coordinates.transform([1, 45], {targetCrs: 9793}));
|
|
40
|
+
console.log(await maptilerclient.coordinates.transform([[10, 48], [1, 45]], {targetCrs: 9793}));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function testData() {
|
|
44
|
+
console.log(await maptilerclient.data.get('2dd5ecc4-3ae1-4d1e-99a2-182256486357'));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function addImage(url) {
|
|
48
|
+
const img = document.createElement("img");
|
|
49
|
+
img.src = url;
|
|
50
|
+
document.getElementById("images").appendChild(img);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function staticMapTest() {
|
|
54
|
+
const imageLinkCentered = maptilerclient.staticMaps.centered([7, 46.8], 5, {
|
|
55
|
+
hiDPI: true,
|
|
56
|
+
width: 1000,
|
|
57
|
+
height: 500,
|
|
58
|
+
style: 'winter',
|
|
59
|
+
markers: [[7, 46, 'green'], [8, 47, '#982']],
|
|
60
|
+
apiKey: "YOUR_PRO_API_KEY",
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
addImage(imageLinkCentered);
|
|
64
|
+
|
|
65
|
+
const imageLinkBounded = maptilerclient.staticMaps.bounded([-9.8905, 36.6274, -6.0453, 42.3208], {
|
|
66
|
+
hiDPI: true,
|
|
67
|
+
width: 1024,
|
|
68
|
+
height: 2048,
|
|
69
|
+
style: 'streets-v2',
|
|
70
|
+
path: [[-9.8905, 36.6274], [-9.8905, 42.3208], [-6.0453, 42.3208], [-6.0453, 36.6274], [-9.8905, 36.6274]],
|
|
71
|
+
pathStrokeColor: 'red',
|
|
72
|
+
pathWidth: 4,
|
|
73
|
+
apiKey: "YOUR_PRO_API_KEY",
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
addImage(imageLinkBounded);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
(async () => {
|
|
81
|
+
await testGeocoding();
|
|
82
|
+
await testGeolocation();
|
|
83
|
+
await testCoordinates();
|
|
84
|
+
await testData();
|
|
85
|
+
staticMapTest();
|
|
86
|
+
})()
|
|
87
|
+
</script>
|
|
88
|
+
</body>
|
|
89
|
+
</html>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
config,
|
|
3
|
+
geocoding,
|
|
4
|
+
geolocation,
|
|
5
|
+
coordinates,
|
|
6
|
+
data,
|
|
7
|
+
LanguageGeocoding,
|
|
8
|
+
} from '../dist/maptiler-client.mjs';
|
|
9
|
+
|
|
10
|
+
// For this examople to work, you must bring your own node-compatible fetch,
|
|
11
|
+
// unles you are using a version of Nodejs that already contains fetch (>=18)
|
|
12
|
+
import fetch from 'node-fetch';
|
|
13
|
+
|
|
14
|
+
config.fetch = fetch;
|
|
15
|
+
config.apiKey = 'YOUR_API_KEY';
|
|
16
|
+
|
|
17
|
+
async function testGeocoding() {
|
|
18
|
+
const result1 = await geocoding.forward('bordeaux', {language: [LanguageGeocoding.AUTO, LanguageGeocoding.ENGLISH]});
|
|
19
|
+
console.log(result1);
|
|
20
|
+
|
|
21
|
+
const result2 = await geocoding.reverse({lng: 6.249638, lat: 46.402056}, {language: ['es', 'en']});
|
|
22
|
+
console.log(result2);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function testGeolocation() {
|
|
26
|
+
const result = await geolocation.info();
|
|
27
|
+
console.log(result);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async function testCoordinates() {
|
|
31
|
+
// searching
|
|
32
|
+
console.log(await coordinates.search('mercator', {transformations: true}));
|
|
33
|
+
console.log(await coordinates.search('plate carree'));
|
|
34
|
+
console.log(await coordinates.search('france'));
|
|
35
|
+
console.log(await coordinates.search('4326', {transformations: true}));
|
|
36
|
+
console.log(await coordinates.search('4326'));
|
|
37
|
+
|
|
38
|
+
// Transforming from wgs84 (default) to lambert93
|
|
39
|
+
console.log(await coordinates.transform({lng: 1, lat: 45}, {targetCrs: 9793}));
|
|
40
|
+
console.log(await coordinates.transform([{lng: 10, lat: 48},{lng: 1, lat: 45}], {targetCrs: 9793}));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async function testData() {
|
|
44
|
+
console.log(await data.get('2dd5ecc4-3ae1-4d1e-99a2-182256486357'));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
(async () => {
|
|
48
|
+
await testGeocoding();
|
|
49
|
+
await testGeolocation();
|
|
50
|
+
await testCoordinates();
|
|
51
|
+
await testData();
|
|
52
|
+
})()
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 630 630">
|
|
2
|
+
<rect width="630" height="630" fill="#f7df1e"/>
|
|
3
|
+
<path d="m423.2 492.19c12.69 20.72 29.2 35.95 58.4 35.95 24.53 0 40.2-12.26 40.2-29.2 0-20.3-16.1-27.49-43.1-39.3l-14.8-6.35c-42.72-18.2-71.1-41-71.1-89.2 0-44.4 33.83-78.2 86.7-78.2 37.64 0 64.7 13.1 84.2 47.4l-46.1 29.6c-10.15-18.2-21.1-25.37-38.1-25.37-17.34 0-28.33 11-28.33 25.37 0 17.76 11 24.95 36.4 35.95l14.8 6.34c50.3 21.57 78.7 43.56 78.7 93 0 53.3-41.87 82.5-98.1 82.5-54.98 0-90.5-26.2-107.88-60.54zm-209.13 5.13c9.3 16.5 17.76 30.45 38.1 30.45 19.45 0 31.72-7.61 31.72-37.2v-201.3h59.2v202.1c0 61.3-35.94 89.2-88.4 89.2-47.4 0-74.85-24.53-88.81-54.075z"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="512" height="512" fill="none" version="1.1" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
|
3
|
+
<title>TypeScript logo</title>
|
|
4
|
+
<rect width="512" height="512" rx="0" fill="#3178c6"/>
|
|
5
|
+
<path d="m317 407v50c8.1 4.2 18 7.3 29 9.4s23 3.1 35 3.1c12 0 23-1.1 34-3.4 11-2.3 20-6.1 28-11 8.1-5.3 15-12 19-21s7.1-19 7.1-32c0-9.1-1.4-17-4.1-24s-6.6-13-12-18c-5.1-5.3-11-10-18-14s-15-8.2-24-12c-6.6-2.7-12-5.3-18-7.9-5.2-2.6-9.7-5.2-13-7.8-3.7-2.7-6.5-5.5-8.5-8.4-2-3-3-6.3-3-10 0-3.4 0.89-6.5 2.7-9.3s4.3-5.1 7.5-7.1c3.2-2 7.2-3.5 12-4.6 4.7-1.1 9.9-1.6 16-1.6 4.2 0 8.6 0.31 13 0.94 4.6 0.63 9.3 1.6 14 2.9 4.7 1.3 9.3 2.9 14 4.9 4.4 2 8.5 4.3 12 6.9v-47c-7.6-2.9-16-5.1-25-6.5s-19-2.1-31-2.1c-12 0-23 1.3-34 3.8s-20 6.5-28 12c-8.1 5.4-14 12-19 21-4.7 8.4-7 18-7 30 0 15 4.3 28 13 38 8.6 11 22 19 39 27 6.9 2.8 13 5.6 19 8.3s11 5.5 15 8.4c4.3 2.9 7.7 6.1 10 9.5 2.5 3.4 3.8 7.4 3.8 12 0 3.2-0.78 6.2-2.3 9s-3.9 5.2-7.1 7.2-7.1 3.6-12 4.8c-4.7 1.1-10 1.7-17 1.7-11 0-22-1.9-32-5.7-11-3.8-21-9.5-30-17zm-84-123h64v-41h-179v41h64v183h51z" clip-rule="evenodd" fill="#fff" fill-rule="evenodd" style="fill:#fff"/>
|
|
6
|
+
</svg>
|
|
Binary file
|