@maptiler/client 1.0.2 → 1.1.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/.github/workflows/npm-publish.yml +0 -1
- package/dist/maptiler-client.cjs +465 -21
- package/dist/maptiler-client.cjs.map +1 -1
- package/dist/maptiler-client.d.ts +395 -2
- package/dist/maptiler-client.min.mjs +1 -1
- package/dist/maptiler-client.mjs +461 -22
- package/dist/maptiler-client.mjs.map +1 -1
- package/dist/maptiler-client.umd.js +465 -21
- package/dist/maptiler-client.umd.js.map +1 -1
- package/dist/maptiler-client.umd.min.js +1 -1
- package/docs/assets/custom.css +118 -0
- package/docs/assets/highlight.css +10 -10
- package/docs/assets/main.js +56 -52
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +23 -0
- package/docs/classes/{ClientConfig.html → config.ClientConfig.html} +34 -24
- package/docs/classes/{ServiceError.html → services_ServiceError.ServiceError.html} +26 -16
- package/docs/functions/language.getAutoLanguageGeocoding.html +60 -0
- package/docs/functions/services_simplify.default.html +65 -0
- package/docs/images/maptiler-logo-256.png +0 -0
- package/docs/index.html +118 -57
- package/docs/modules/config.html +71 -0
- package/docs/modules/language.html +71 -0
- package/docs/modules/services_ServiceError.html +61 -0
- package/docs/modules/services_coordinates.html +84 -0
- package/docs/modules/services_data.html +66 -0
- package/docs/modules/services_geocoding.html +76 -0
- package/docs/modules/services_geolocation.html +68 -0
- package/docs/modules/services_simplify.html +61 -0
- package/docs/modules/services_staticMaps.html +74 -0
- package/docs/modules.html +23 -83
- package/docs/types/config.FetchFunction.html +71 -0
- package/docs/types/language.LanguageGeocodingString.html +58 -0
- package/docs/types/services_coordinates.CoordinateExport.html +71 -0
- package/docs/types/services_coordinates.CoordinateGrid.html +69 -0
- package/docs/types/services_coordinates.CoordinateId.html +71 -0
- package/docs/types/services_coordinates.CoordinateSearch.html +93 -0
- package/docs/types/services_coordinates.CoordinateSearchResult.html +75 -0
- package/docs/types/services_coordinates.CoordinateTransformResult.html +76 -0
- package/docs/types/services_coordinates.CoordinateTransformation.html +89 -0
- package/docs/types/services_coordinates.CoordinatesSearchOptions.html +83 -0
- package/docs/types/services_coordinates.CoordinatesTransformOptions.html +85 -0
- package/docs/types/services_coordinates.XYZ.html +73 -0
- package/docs/types/services_data.GetDataOptions.html +64 -0
- package/docs/types/services_geocoding.Coordinates.html +60 -0
- package/docs/types/services_geocoding.FeatureHierarchy.html +71 -0
- package/docs/types/services_geocoding.GeocodingFeature.html +60 -0
- package/docs/types/services_geocoding.GeocodingOptions.html +79 -0
- package/docs/types/services_geocoding.GeocodingSearchResult.html +77 -0
- package/docs/types/services_geocoding.ReverseGeocodingOptions.html +71 -0
- package/docs/types/services_geolocation.GeolocationInfoOptions.html +65 -0
- package/docs/types/services_geolocation.GeolocationResult.html +128 -0
- package/docs/types/services_staticMaps.AutomaticStaticMapOptions.html +61 -0
- package/docs/types/services_staticMaps.BoundedStaticMapOptions.html +61 -0
- package/docs/types/services_staticMaps.CenteredStaticMapOptions.html +61 -0
- package/docs/types/{StaticMapBaseOptions.html → services_staticMaps.StaticMapBaseOptions.html} +26 -45
- package/docs/types/services_staticMaps.StaticMapMarker.html +61 -0
- package/docs/variables/config.config.html +58 -0
- package/docs/variables/{LanguageGeocoding.html → language.LanguageGeocoding.html} +20 -42
- package/docs/variables/services_coordinates.coordinates.html +110 -0
- package/docs/variables/services_data.data.html +80 -0
- package/docs/variables/{geocoding.html → services_geocoding.geocoding.html} +35 -53
- package/docs/variables/services_geolocation.geolocation.html +79 -0
- package/docs/variables/services_staticMaps.staticMaps.html +128 -0
- package/docsmd/README.md +143 -36
- package/docsmd/assets/custom.css +118 -0
- package/docsmd/classes/ClientConfig.md +5 -5
- package/docsmd/classes/MapStyleVariant.md +217 -0
- package/docsmd/classes/ReferenceMapStyle.md +169 -0
- package/docsmd/classes/ServiceError.md +3 -3
- package/examples/test-browser-umd.html +1 -1
- package/images/maptiler-logo-256.png +0 -0
- package/package.json +5 -5
- package/readme.md +65 -5
- package/src/index.ts +17 -0
- package/src/mapstyle.ts +841 -0
- package/src/services/staticMaps.ts +5 -4
- package/tsconfig.json +0 -1
- package/typedoc.css +118 -0
- package/typedoc.json +7 -3
- package/docs/types/AutomaticStaticMapOptions.html +0 -80
- package/docs/types/BoundedStaticMapOptions.html +0 -80
- package/docs/types/CenteredStaticMapOptions.html +0 -80
- package/docs/types/CoordinateExport.html +0 -85
- package/docs/types/CoordinateGrid.html +0 -83
- package/docs/types/CoordinateId.html +0 -85
- package/docs/types/CoordinateSearch.html +0 -107
- package/docs/types/CoordinateSearchResult.html +0 -89
- package/docs/types/CoordinateTransformResult.html +0 -90
- package/docs/types/CoordinateTransformation.html +0 -103
- package/docs/types/Coordinates.html +0 -78
- package/docs/types/CoordinatesSearchOptions.html +0 -97
- package/docs/types/CoordinatesTransformOptions.html +0 -99
- package/docs/types/FeatureHierarchy.html +0 -89
- package/docs/types/FetchFunction.html +0 -93
- package/docs/types/GeocodingFeature.html +0 -78
- package/docs/types/GeocodingOptions.html +0 -97
- package/docs/types/GeocodingSearchResult.html +0 -95
- package/docs/types/GeolocationInfoOptions.html +0 -87
- package/docs/types/GeolocationResult.html +0 -150
- package/docs/types/GetDataOptions.html +0 -87
- package/docs/types/LanguageGeocodingString.html +0 -80
- package/docs/types/ReverseGeocodingOptions.html +0 -89
- package/docs/types/StaticMapMarker.html +0 -80
- package/docs/types/XYZ.html +0 -87
- package/docs/variables/config.html +0 -80
- package/docs/variables/coordinates-1.html +0 -124
- package/docs/variables/data.html +0 -103
- package/docs/variables/geolocation.html +0 -101
- package/docs/variables/staticMaps.html +0 -147
- package/docsmd/images/JS-logo.svg +0 -4
- package/docsmd/images/TS-logo.svg +0 -6
- package/docsmd/images/maptiler-client-logo.afdesign +0 -0
- package/docsmd/images/maptiler-client-logo.svg +0 -75
- package/docsmd/images/maptiler-logo.svg +0 -23
- 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/docs/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>MapTiler Client
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>MapTiler Client - v1.1.0</title><meta name="description" content="Documentation for MapTiler Client - v1.1.0"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><link rel="stylesheet" href="assets/custom.css"/><script async src="assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
2
|
<div class="tsd-toolbar-contents container">
|
|
3
3
|
<div class="table-cell" id="tsd-search" data-base=".">
|
|
4
4
|
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
<div id="tsd-toolbar-links"></div></div>
|
|
7
7
|
<ul class="results">
|
|
8
8
|
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">MapTiler Client
|
|
9
|
+
<li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">MapTiler Client - v1.1.0</a></div>
|
|
10
10
|
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
11
|
<div class="container container-main">
|
|
12
12
|
<div class="col-8 col-content">
|
|
13
13
|
<div class="tsd-page-title">
|
|
14
|
-
<h2>MapTiler Client
|
|
14
|
+
<h2>MapTiler Client - v1.1.0</h2></div>
|
|
15
15
|
<div class="tsd-panel tsd-typography"><p align="center">
|
|
16
|
+
<a href="https://www.maptiler.com/">offcial page →</a><br>
|
|
16
17
|
<img src="images/maptiler-client-logo.svg" width="400px">
|
|
17
18
|
</p>
|
|
18
19
|
|
|
@@ -28,8 +29,12 @@
|
|
|
28
29
|
</p>
|
|
29
30
|
|
|
30
31
|
|
|
31
|
-
<a href="#
|
|
32
|
-
<h1>
|
|
32
|
+
<a href="#api-client-library-for-javascript--typescript" id="api-client-library-for-javascript--typescript" style="color: inherit; text-decoration: none;">
|
|
33
|
+
<h1>API Client Library for JavaScript / TypeScript</h1>
|
|
34
|
+
</a>
|
|
35
|
+
|
|
36
|
+
<a href="#what" id="what" style="color: inherit; text-decoration: none;">
|
|
37
|
+
<h2>What?</h2>
|
|
33
38
|
</a>
|
|
34
39
|
<p>The <strong>MapTiler Client JS</strong> exposes a number of handy functions that wrap API call to <a href="https://docs.maptiler.com/cloud/api">MapTiler Cloud API services</a>, such as:</p>
|
|
35
40
|
<ul>
|
|
@@ -39,7 +44,22 @@
|
|
|
39
44
|
<li>User data fetching as GeoJSON</li>
|
|
40
45
|
<li>Static maps of all sorts</li>
|
|
41
46
|
</ul>
|
|
47
|
+
|
|
48
|
+
<a href="#why" id="why" style="color: inherit; text-decoration: none;">
|
|
49
|
+
<h2>Why?</h2>
|
|
50
|
+
</a>
|
|
42
51
|
<p>The project is entirely written in TypeScript and all the function arguments are nicely documented and typed.</p>
|
|
52
|
+
<ul>
|
|
53
|
+
<li>Better developer experience of working with APIs in the code editor - with parameter info, quick info, and member lists.<ul>
|
|
54
|
+
<li>Code completion: reducing typos and other common mistakes</li>
|
|
55
|
+
<li>Content assist and code hinting providing contextual help</li>
|
|
56
|
+
</ul>
|
|
57
|
+
</li>
|
|
58
|
+
<li>Type safety - for higher quality code and testing</li>
|
|
59
|
+
<li>Backward compatibility: guaranteed on changes to API endpoints</li>
|
|
60
|
+
<li>Runs: in Node.js or in browser</li>
|
|
61
|
+
<li>Open source license</li>
|
|
62
|
+
</ul>
|
|
43
63
|
<blockquote>
|
|
44
64
|
<p>📣 <em><strong>Note:</strong></em> If you need <em>this</em> API wrapper <strong>AND</strong> a complete SDK to display beautiful interactive maps, then checkout <a href="https://github.com/maptiler/maptiler-sdk-js">MapTiler SDK JS</a>, it contains it all!</p>
|
|
45
65
|
</blockquote>
|
|
@@ -47,18 +67,18 @@
|
|
|
47
67
|
<a href="#install" id="install" style="color: inherit; text-decoration: none;">
|
|
48
68
|
<h1>Install</h1>
|
|
49
69
|
</a>
|
|
50
|
-
<pre><code class="language-shell"><span class="hl-0">npm install
|
|
70
|
+
<pre><code class="language-shell"><span class="hl-0">npm </span><span class="hl-1">install</span><span class="hl-0"> </span><span class="hl-1">--save</span><span class="hl-0"> </span><span class="hl-1">@maptiler/client</span>
|
|
51
71
|
</code></pre>
|
|
52
72
|
|
|
53
73
|
<a href="#api-documentation" id="api-documentation" style="color: inherit; text-decoration: none;">
|
|
54
74
|
<h1>API documentation</h1>
|
|
55
75
|
</a>
|
|
56
|
-
<p>In addition to the details and examples provided in this readme, check out the <a href="
|
|
76
|
+
<p>In addition to the details and examples provided in this readme, check out the <a href="https://maptiler.github.io/maptiler-client-js">complete API documentation</a>.</p>
|
|
57
77
|
|
|
58
78
|
<a href="#quick-start" id="quick-start" style="color: inherit; text-decoration: none;">
|
|
59
79
|
<h1>Quick start</h1>
|
|
60
80
|
</a>
|
|
61
|
-
<pre><code class="language-ts"><span class="hl-
|
|
81
|
+
<pre><code class="language-ts"><span class="hl-2">// Import the whole library</span><br/><span class="hl-3">import</span><span class="hl-0"> </span><span class="hl-4">*</span><span class="hl-0"> </span><span class="hl-3">as</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0"> </span><span class="hl-3">from</span><span class="hl-0"> </span><span class="hl-1">'@maptiler/client'</span><span class="hl-0">;</span><br/><br/><span class="hl-2">// Or import only the bits you need</span><br/><span class="hl-3">import</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-5">config</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-5">geocoding</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-5">geolocation</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-5">coordinates</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-5">data</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-5">staticMaps</span><span class="hl-0">,</span><br/><span class="hl-0">} </span><span class="hl-3">from</span><span class="hl-0"> </span><span class="hl-1">'@maptiler/client'</span><span class="hl-0">;</span>
|
|
62
82
|
</code></pre>
|
|
63
83
|
<p>The <a href="examples/">examples</a> folder includes are featuring usages for <strong>NodeJS</strong>, <strong>browser with UMD</strong> and <strong>browser with ES module</strong>.</p>
|
|
64
84
|
|
|
@@ -70,12 +90,15 @@
|
|
|
70
90
|
<a href="#🔍-geocoding" id="🔍-geocoding" style="color: inherit; text-decoration: none;">
|
|
71
91
|
<h2>🔍 Geocoding</h2>
|
|
72
92
|
</a>
|
|
93
|
+
<blockquote>
|
|
94
|
+
<p>✅ Please, use geocoding responses in the context of server-side rendering, hydration or client-side rendering, but do not 🚫 store or redistribute MapTiler Cloud API data. In case of doubt, consult the <a href="https://www.maptiler.com/cloud/terms/#explicitly-prohibited-use">terms</a> ⚖️</p>
|
|
95
|
+
</blockquote>
|
|
73
96
|
|
|
74
97
|
<a href="#forward" id="forward" style="color: inherit; text-decoration: none;">
|
|
75
98
|
<h3>Forward</h3>
|
|
76
99
|
</a>
|
|
77
100
|
<p>You want to know the longitude and latitude of a specific place, use the forward geocoding:</p>
|
|
78
|
-
<pre><code class="language-ts"><span class="hl-
|
|
101
|
+
<pre><code class="language-ts"><span class="hl-2">// in an async function, or as a 'thenable':</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">result</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">geocoding</span><span class="hl-0">.</span><span class="hl-7">forward</span><span class="hl-0">(</span><span class="hl-1">'paris'</span><span class="hl-0">);</span>
|
|
79
102
|
</code></pre>
|
|
80
103
|
<p>You can provide some options such as:</p>
|
|
81
104
|
<ul>
|
|
@@ -89,7 +112,7 @@
|
|
|
89
112
|
<h3>Reverse</h3>
|
|
90
113
|
</a>
|
|
91
114
|
<p>You wan to tknow the name of a place, given a longitude-latitude? Use the reverse geocoding:</p>
|
|
92
|
-
<pre><code class="language-ts"><span class="hl-
|
|
115
|
+
<pre><code class="language-ts"><span class="hl-2">// in an async function, or as a 'thenable':</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">result</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">geocoding</span><span class="hl-0">.</span><span class="hl-7">reverse</span><span class="hl-0">([</span><span class="hl-8">6.249638</span><span class="hl-0">, </span><span class="hl-8">46.402056</span><span class="hl-0">]);</span>
|
|
93
116
|
</code></pre>
|
|
94
117
|
<p>The same option object as the forward geocoding can be provided.</p>
|
|
95
118
|
<p>Read more about reverse geocoding on our official <a href="https://docs.maptiler.com/cloud/api/geocoding/#search-by-coordinates-reverse">API documentation</a>.</p>
|
|
@@ -98,29 +121,35 @@
|
|
|
98
121
|
<h3>Language</h3>
|
|
99
122
|
</a>
|
|
100
123
|
<p>For both <em>forward</em> and <em>reverse</em> geocoding, this library provides a list of supported languages as shorthands to <a href="https://en.wikipedia.org/wiki/ISO_639-1">ISO language codes</a>. The result will be provided in multiple languages if the <code>language</code> options is an array:</p>
|
|
101
|
-
<pre><code class="language-ts"><span class="hl-
|
|
124
|
+
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">result</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">geocoding</span><span class="hl-0">.</span><span class="hl-7">forward</span><span class="hl-0">(</span><span class="hl-1">'paris'</span><span class="hl-0">, {</span><span class="hl-5">language:</span><span class="hl-0"> [</span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">geocoding</span><span class="hl-0">.</span><span class="hl-5">languages</span><span class="hl-0">.</span><span class="hl-6">SPANISH</span><span class="hl-0">, </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">geocoding</span><span class="hl-0">.</span><span class="hl-5">languages</span><span class="hl-0">.</span><span class="hl-6">KOREAN</span><span class="hl-0">]})</span>
|
|
102
125
|
</code></pre>
|
|
103
126
|
<p>The special language <code>AUTO</code> will detect the plateform/browser prefered language.</p>
|
|
104
127
|
|
|
105
128
|
<a href="#🕵️♂️-geolocation" id="🕵️♂️-geolocation" style="color: inherit; text-decoration: none;">
|
|
106
129
|
<h2>🕵️♂️ Geolocation</h2>
|
|
107
130
|
</a>
|
|
131
|
+
<blockquote>
|
|
132
|
+
<p>✅ Please, use geolocation responses in the context of server-side rendering, hydration or client-side rendering, but do not 🚫 store or redistribute MapTiler Cloud API data. In case of doubt, consult the <a href="https://www.maptiler.com/cloud/terms/#explicitly-prohibited-use">terms</a> ⚖️</p>
|
|
133
|
+
</blockquote>
|
|
108
134
|
<p>The geolocation service provides an accurate location insight of a website visitor using its IP address.</p>
|
|
109
135
|
<p>There is only a single function:</p>
|
|
110
|
-
<pre><code class="language-ts"><span class="hl-
|
|
136
|
+
<pre><code class="language-ts"><span class="hl-2">// in an async function, or as a 'thenable':</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">result</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">geolocation</span><span class="hl-0">.</span><span class="hl-7">info</span><span class="hl-0">();</span>
|
|
111
137
|
</code></pre>
|
|
112
138
|
<p>Read more about geolocation on our official <a href="https://docs.maptiler.com/cloud/api/geolocation/">API documentation</a>.</p>
|
|
113
139
|
|
|
114
140
|
<a href="#🌐-coordinates" id="🌐-coordinates" style="color: inherit; text-decoration: none;">
|
|
115
141
|
<h2>🌐 Coordinates</h2>
|
|
116
142
|
</a>
|
|
143
|
+
<blockquote>
|
|
144
|
+
<p>✅ Please, use coordinate responses in the context of server-side rendering, hydration or client-side rendering, but do not 🚫 store or redistribute MapTiler Cloud API data. In case of doubt, consult the <a href="https://www.maptiler.com/cloud/terms/#explicitly-prohibited-use">terms</a> ⚖️</p>
|
|
145
|
+
</blockquote>
|
|
117
146
|
<p>If you are already familiar with <a href="https://epsg.io/">epsg.io</a> (created by MapTiler), then you may find convenient to access the details of more than 10 thousands of coordinate reference systems (CRS) programmatically, as well as transforming coordinates from one system to another!</p>
|
|
118
147
|
|
|
119
148
|
<a href="#search" id="search" style="color: inherit; text-decoration: none;">
|
|
120
149
|
<h3>Search</h3>
|
|
121
150
|
</a>
|
|
122
151
|
<p>The <code>search</code> lets you perform a query in a free form fashion. Here are some examples:</p>
|
|
123
|
-
<pre><code class="language-ts"><span class="hl-
|
|
152
|
+
<pre><code class="language-ts"><span class="hl-2">// in an async function, or as a 'thenable':</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">resultA</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">coordinates</span><span class="hl-0">.</span><span class="hl-7">search</span><span class="hl-0">(</span><span class="hl-1">'mercator'</span><span class="hl-0">);</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">resultB</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">coordinates</span><span class="hl-0">.</span><span class="hl-7">search</span><span class="hl-0">(</span><span class="hl-1">'plate carree'</span><span class="hl-0">);</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">resultC</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">coordinates</span><span class="hl-0">.</span><span class="hl-7">search</span><span class="hl-0">(</span><span class="hl-1">'france'</span><span class="hl-0">);</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">resultD</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">coordinates</span><span class="hl-0">.</span><span class="hl-7">search</span><span class="hl-0">(</span><span class="hl-1">'code:4326'</span><span class="hl-0">, {</span><span class="hl-5">transformations:</span><span class="hl-0"> </span><span class="hl-4">true</span><span class="hl-0">}));</span>
|
|
124
153
|
</code></pre>
|
|
125
154
|
<p>The <code>transformations</code> options retrieves a lot more details about the CRS that MapTiler API is able to transform to/from than just their IDs.</p>
|
|
126
155
|
<p>Read more about searching coordinate systems on our official <a href="https://docs.maptiler.com/cloud/api/coordinates/#search-coordinate-systems">API documentation</a>.</p>
|
|
@@ -130,7 +159,7 @@
|
|
|
130
159
|
</a>
|
|
131
160
|
<p>Transforming a couple of coordinates from one system to another can be challenging, for example, most countries have their own official system, yet web mapping tools are more often than not exclusive to <a href="https://epsg.io/4326">WGS84</a>.</p>
|
|
132
161
|
<p>If not provided, both the source (<code>sourceCrs</code>) and the destination (<code>targetCrs</code>) are default to <strong>EPSG:4326</strong> (in other words, <a href="https://epsg.io/4326">WGS84</a>). Here is how to use this feature:</p>
|
|
133
|
-
<pre><code class="language-ts"><span class="hl-
|
|
162
|
+
<pre><code class="language-ts"><span class="hl-2">// in an async function, or as a 'thenable':</span><br/><br/><span class="hl-2">// Providing one coordinate to transform, with a target CRS being EPSG:9793 (RGF93 v2 / Lambert-93, France official CRS)</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">resultA</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">coordinates</span><span class="hl-0">.</span><span class="hl-7">transform</span><span class="hl-0">([</span><span class="hl-8">1</span><span class="hl-0">, </span><span class="hl-8">45</span><span class="hl-0">], {</span><span class="hl-5">targetCrs:</span><span class="hl-0"> </span><span class="hl-8">9793</span><span class="hl-0">})</span><br/><br/><span class="hl-2">// Using the same logic, we can pass up to 50 coordinates to be transformed</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">resultB</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">coordinates</span><span class="hl-0">.</span><span class="hl-7">transform</span><span class="hl-0">([[</span><span class="hl-8">10</span><span class="hl-0">, </span><span class="hl-8">48</span><span class="hl-0">], [</span><span class="hl-8">1</span><span class="hl-0">, </span><span class="hl-8">45</span><span class="hl-0">]], {</span><span class="hl-5">targetCrs:</span><span class="hl-0"> </span><span class="hl-8">9793</span><span class="hl-0">})</span>
|
|
134
163
|
</code></pre>
|
|
135
164
|
<p>Read more about transforming coordinates on our official <a href="https://docs.maptiler.com/cloud/api/coordinates/#transform-coordinates">API documentation</a>.</p>
|
|
136
165
|
|
|
@@ -138,13 +167,16 @@
|
|
|
138
167
|
<h2>💽 Data</h2>
|
|
139
168
|
</a>
|
|
140
169
|
<p>MapTiler Cloud give its users the possibility to <a href="https://cloud.maptiler.com/data/">upload and create data</a>, manually with a user interface or by uploading a GPX, GeoJSON, KML or shp file. A unique ID is associated to each dataset so that we can later on access it programmatically to retrieve a GeoJSON equivalent of it:</p>
|
|
141
|
-
<pre><code class="language-ts"><span class="hl-
|
|
170
|
+
<pre><code class="language-ts"><span class="hl-2">// in an async function, or as a 'thenable':</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">result</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">data</span><span class="hl-0">.</span><span class="hl-7">get</span><span class="hl-0">(</span><span class="hl-1">'my-dataset-unique-id'</span><span class="hl-0">)</span>
|
|
142
171
|
</code></pre>
|
|
143
172
|
<p>Since the result is a GeoJSON, it can easily be added to a <code>map</code> with <code>.addSource()</code> and <code>.addLayer()</code>.</p>
|
|
144
173
|
|
|
145
174
|
<a href="#🗺️-static-maps" id="🗺️-static-maps" style="color: inherit; text-decoration: none;">
|
|
146
175
|
<h2>🗺️ Static maps</h2>
|
|
147
176
|
</a>
|
|
177
|
+
<blockquote>
|
|
178
|
+
<p>✅ Please, use static maps URLs only from client side <code><img></code> elements, and do not 🚫 store or redistribute the static map files. In case of doubt, consult the <a href="https://www.maptiler.com/cloud/terms/#explicitly-prohibited-use">terms</a> ⚖️</p>
|
|
179
|
+
</blockquote>
|
|
148
180
|
<p>Maptiler Cloud provides many possibilities for creating static maps as PNG, JPEG or WebP images. They all offer the possibilities to:</p>
|
|
149
181
|
<ul>
|
|
150
182
|
<li>Choose from one of the MapTiler style or your own</li>
|
|
@@ -156,11 +188,63 @@
|
|
|
156
188
|
<p>📣 <em><strong>important:</strong></em> Contrary to the geolocation/geocoding/coordinates/data service wrappers, the static maps function <strong>does not</strong> perform any query to the MapTiler API, instead they build the image URL. We took this decision because images are most likely going to be displayed in <code><img src="path.png"></img></code> markups and will naturaly be fetched by the web browser.</p>
|
|
157
189
|
</blockquote>
|
|
158
190
|
|
|
191
|
+
<a href="#map-styles" id="map-styles" style="color: inherit; text-decoration: none;">
|
|
192
|
+
<h3>Map Styles</h3>
|
|
193
|
+
</a>
|
|
194
|
+
<p>In the following static map functions, the <code>option</code> object features a <code>style</code> property that can be a string or one of the built-in style shorthand. Here is the full list:</p>
|
|
195
|
+
<ul>
|
|
196
|
+
<li><code>MapStyle.STREETS</code>, reference style for navigation and city exploration<ul>
|
|
197
|
+
<li><code>MapStyle.STREETS.DARK</code> (variant)</li>
|
|
198
|
+
<li><code>MapStyle.STREETS.LIGHT</code> (variant)</li>
|
|
199
|
+
<li><code>MapStyle.STREETS.PASTEL</code> (variant)</li>
|
|
200
|
+
</ul>
|
|
201
|
+
</li>
|
|
202
|
+
<li><code>MapStyle.OUTDOOR</code> reference style for adventure</li>
|
|
203
|
+
<li><code>MapStyle.WINTER</code> reference style for winter adventure</li>
|
|
204
|
+
<li><code>MapStyle.SATELLITE</code> reference style satellite and airborne imagery (no variants)</li>
|
|
205
|
+
<li><code>MapStyle.HYBRID</code> reference style satellite and airborne imagery with labels (no variants)</li>
|
|
206
|
+
<li><code>MapStyle.BASIC</code> reference style for minimalist design and general purpose<ul>
|
|
207
|
+
<li><code>MapStyle.BASIC.DARK</code> (variant)</li>
|
|
208
|
+
<li><code>MapStyle.BASIC.LIGHT</code> (variant)</li>
|
|
209
|
+
</ul>
|
|
210
|
+
</li>
|
|
211
|
+
<li><code>MapStyle.BRIGHT</code> reference style for high contrast navigation<ul>
|
|
212
|
+
<li><code>MapStyle.BRIGHT.DARK</code> (variant)</li>
|
|
213
|
+
<li><code>MapStyle.BRIGHT.LIGHT</code> (variant)</li>
|
|
214
|
+
<li><code>MapStyle.BRIGHT.PASTEL</code> (variant)</li>
|
|
215
|
+
</ul>
|
|
216
|
+
</li>
|
|
217
|
+
<li><code>MapStyle.TOPO</code> reference style for topographic study<ul>
|
|
218
|
+
<li><code>MapStyle.TOPO.SHINY</code> (variant)</li>
|
|
219
|
+
<li><code>MapStyle.TOPO.PASTEL</code> (variant)</li>
|
|
220
|
+
<li><code>MapStyle.TOPO.TOPOGRAPHIQUE</code> (variant)</li>
|
|
221
|
+
</ul>
|
|
222
|
+
</li>
|
|
223
|
+
<li><code>MapStyle.VOYAGER</code> reference style for stylish yet minimalist maps<ul>
|
|
224
|
+
<li><code>MapStyle.VOYAGER.DARK</code> (variant)</li>
|
|
225
|
+
<li><code>MapStyle.VOYAGER.LIGHT</code> (variant)</li>
|
|
226
|
+
<li><code>MapStyle.VOYAGER.VINTAGE</code> (variant)</li>
|
|
227
|
+
</ul>
|
|
228
|
+
</li>
|
|
229
|
+
<li><code>MapStyle.TONER</code> reference style for very high contrast stylish maps <ul>
|
|
230
|
+
<li><code>MapStyle.TONER.BACKGROUND</code> (variant)</li>
|
|
231
|
+
<li><code>MapStyle.TONER.LITE</code> (variant)</li>
|
|
232
|
+
<li><code>MapStyle.TONER.LINES</code> (variant)</li>
|
|
233
|
+
</ul>
|
|
234
|
+
</li>
|
|
235
|
+
<li><code>MapStyle.OPENSTREETMAP</code> (reference style, this one does not have any variants)</li>
|
|
236
|
+
<li><code>MapStyle.STAGE</code>, the perfect style for data visualization, with very little noise<ul>
|
|
237
|
+
<li><code>MapStyle.STAGE.DARK</code> (variant)</li>
|
|
238
|
+
<li><code>MapStyle.STAGE.LIGHT</code> (variant)</li>
|
|
239
|
+
</ul>
|
|
240
|
+
</li>
|
|
241
|
+
</ul>
|
|
242
|
+
|
|
159
243
|
<a href="#centered-static-maps" id="centered-static-maps" style="color: inherit; text-decoration: none;">
|
|
160
244
|
<h3>Centered static maps</h3>
|
|
161
245
|
</a>
|
|
162
246
|
<p>This type of map is centered on a longitude-latitude coordinate and the zoom level must also be provided (from <code>0</code>: very zoomed out, to <code>22</code>: very zoomed in).<br>Note that if a path or markers are provided, the framing of the map will not automatically adapt to include those (use the <code>automatic</code> mode for that).</p>
|
|
163
|
-
<pre><code class="language-ts"><span class="hl-
|
|
247
|
+
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">imageLink</span><span class="hl-0"> = </span><span class="hl-5">maptiler</span><span class="hl-0">.</span><span class="hl-5">staticMaps</span><span class="hl-0">.</span><span class="hl-7">centered</span><span class="hl-0">(</span><br/><span class="hl-0"> </span><span class="hl-2">// center position (Boston)</span><br/><span class="hl-0"> [-</span><span class="hl-8">71.06080</span><span class="hl-0">, </span><span class="hl-8">42.362114</span><span class="hl-0">], </span><br/><br/><span class="hl-0"> </span><span class="hl-2">// zoom level</span><br/><span class="hl-0"> </span><span class="hl-8">12.5</span><span class="hl-0">, </span><br/><span class="hl-0"> </span><br/><span class="hl-0"> </span><span class="hl-2">// Options</span><br/><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-2">// Request a hiDPI/Retina image</span><br/><span class="hl-0"> </span><span class="hl-5">hiDPI:</span><span class="hl-0"> </span><span class="hl-4">true</span><span class="hl-0">,</span><br/><br/><span class="hl-0"> </span><span class="hl-2">// Output image size</span><br/><span class="hl-0"> </span><span class="hl-5">width:</span><span class="hl-0"> </span><span class="hl-8">1000</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-5">height:</span><span class="hl-0"> </span><span class="hl-8">1000</span><span class="hl-0">,</span><br/><br/><span class="hl-0"> </span><span class="hl-2">// Map style</span><br/><span class="hl-0"> </span><span class="hl-5">style:</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">MapStyle</span><span class="hl-0">.</span><span class="hl-6">OUTDOOR</span><span class="hl-0">,</span><br/><span class="hl-0"> });</span>
|
|
164
248
|
</code></pre>
|
|
165
249
|
<p>Read more about centered static maps on our official <a href="https://docs.maptiler.com/cloud/api/static-maps/#center-based-image">API documentation</a>.</p>
|
|
166
250
|
|
|
@@ -168,7 +252,7 @@
|
|
|
168
252
|
<h3>Bounded static maps</h3>
|
|
169
253
|
</a>
|
|
170
254
|
<p>This type of map requires a bounding box made of two points: the south-west bound and the north-east bound. The zoom level cannot be provided and is automatically deduced from the size of the bounding box.</p>
|
|
171
|
-
<pre><code class="language-ts"><span class="hl-
|
|
255
|
+
<pre><code class="language-ts"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">imageLink</span><span class="hl-0"> = </span><span class="hl-5">maptiler</span><span class="hl-0">.</span><span class="hl-5">staticMaps</span><span class="hl-0">.</span><span class="hl-7">bounded</span><span class="hl-0">(</span><br/><span class="hl-0"> </span><span class="hl-2">// The bounding box on Europe</span><br/><span class="hl-0"> [</span><br/><span class="hl-0"> -</span><span class="hl-8">24</span><span class="hl-0">, </span><span class="hl-2">// west bound (min x)</span><br/><span class="hl-0"> </span><span class="hl-8">34.5</span><span class="hl-0">, </span><span class="hl-2">// south bound (min y)</span><br/><span class="hl-0"> </span><span class="hl-8">32</span><span class="hl-0">, </span><span class="hl-2">// east bound (max x)</span><br/><span class="hl-0"> </span><span class="hl-8">71</span><span class="hl-0">, </span><span class="hl-2">// north bound (max y)</span><br/><span class="hl-0"> ],</span><br/><br/><span class="hl-0"> </span><span class="hl-2">// Options</span><br/><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-5">hiDPI:</span><span class="hl-0"> </span><span class="hl-4">true</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-5">width:</span><span class="hl-0"> </span><span class="hl-8">2048</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-5">height:</span><span class="hl-0"> </span><span class="hl-8">2048</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-5">style:</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">MapStyle</span><span class="hl-0">.</span><span class="hl-6">STREETS</span><span class="hl-0">.</span><span class="hl-6">DARK</span><span class="hl-0">,</span><br/><br/><span class="hl-0"> </span><span class="hl-2">// Extra space that will add around the bounding box, in percentage</span><br/><span class="hl-0"> </span><span class="hl-2">// (0.1 = 10% is actually the dafault)</span><br/><span class="hl-0"> </span><span class="hl-5">padding:</span><span class="hl-0"> </span><span class="hl-8">0.1</span><br/><span class="hl-0"> });</span>
|
|
172
256
|
</code></pre>
|
|
173
257
|
<p>Since the zoom level cannot be provided, the level of details is dictated by the size of the output image. here is an example:</p>
|
|
174
258
|
<table>
|
|
@@ -203,7 +287,7 @@
|
|
|
203
287
|
</a>
|
|
204
288
|
<p>As we have seen with centered and bounded maps, providing all the parameters is nice but can be cumbersome for the simplest use cases. This is why MapTiler Cloud also provides static maps that fits automatically whatever you need to place inside: path or markers.</p>
|
|
205
289
|
<p>In the following example, we are going to load a cycling track recorded by one of our team members in Montreal, Canada. The track, originally a GPX file, was pushed to MapTiler Data and is now made avalable as a GeoJSON:</p>
|
|
206
|
-
<pre><code class="language-ts"><span class="hl-
|
|
290
|
+
<pre><code class="language-ts"><span class="hl-2">// Fetching the GeoJSON</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">bikeTrack</span><span class="hl-0"> = </span><span class="hl-3">await</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">data</span><span class="hl-0">.</span><span class="hl-7">get</span><span class="hl-0">(</span><span class="hl-1">'the-id-of-a-bike-track-in-montreal'</span><span class="hl-0">);</span><br/><br/><span class="hl-2">// Extracting the track points with the shape [[lng, lat], [lng, lat], ...]</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">trackPoints</span><span class="hl-0"> = </span><span class="hl-5">bikeTrack</span><span class="hl-0">.</span><span class="hl-5">features</span><span class="hl-0">[</span><span class="hl-8">0</span><span class="hl-0">].</span><span class="hl-5">geometry</span><span class="hl-0">.</span><span class="hl-5">coordinates</span><span class="hl-0">[</span><span class="hl-8">0</span><span class="hl-0">]</span><br/><span class="hl-0"> .</span><span class="hl-7">map</span><span class="hl-0">(</span><span class="hl-5">p</span><span class="hl-0"> </span><span class="hl-4">=></span><span class="hl-0"> </span><span class="hl-5">p</span><span class="hl-0">.</span><span class="hl-7">slice</span><span class="hl-0">(</span><span class="hl-8">0</span><span class="hl-0">, </span><span class="hl-8">2</span><span class="hl-0">));</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-6">imageLink</span><span class="hl-0"> = </span><span class="hl-5">maptiler</span><span class="hl-0">.</span><span class="hl-5">staticMaps</span><span class="hl-0">.</span><span class="hl-7">automatic</span><span class="hl-0">({</span><br/><span class="hl-0"> </span><span class="hl-2">// hiDPI/Retina precision</span><br/><span class="hl-0"> </span><span class="hl-5">hiDPI:</span><span class="hl-0"> </span><span class="hl-4">true</span><span class="hl-0">,</span><br/><br/><span class="hl-0"> </span><span class="hl-2">// A farily large output image</span><br/><span class="hl-0"> </span><span class="hl-5">width:</span><span class="hl-0"> </span><span class="hl-8">2048</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-5">height:</span><span class="hl-0"> </span><span class="hl-8">1024</span><span class="hl-0"> ,</span><br/><br/><span class="hl-0"> </span><span class="hl-2">// A grey style on which the track will pop!</span><br/><span class="hl-0"> </span><span class="hl-5">style:</span><span class="hl-0"> </span><span class="hl-5">maptilerClient</span><span class="hl-0">.</span><span class="hl-5">MapStyle</span><span class="hl-0">.</span><span class="hl-6">STREETS</span><span class="hl-0">.</span><span class="hl-6">LIGHT</span><span class="hl-0">,</span><br/><br/><span class="hl-0"> </span><span class="hl-2">// Draw a path with the trackpoints</span><br/><span class="hl-0"> </span><span class="hl-5">path:</span><span class="hl-0"> </span><span class="hl-5">trackPoints</span><span class="hl-0">,</span><br/><br/><span class="hl-0"> </span><span class="hl-2">// Adding a marker for the starting point, with a custom color (array of shape [lng, lat, color])</span><br/><span class="hl-0"> </span><span class="hl-5">marker:</span><span class="hl-0"> [</span><span class="hl-5">trackPoints</span><span class="hl-0">[</span><span class="hl-8">0</span><span class="hl-0">][</span><span class="hl-8">0</span><span class="hl-0">], </span><span class="hl-5">trackPoints</span><span class="hl-0">[</span><span class="hl-8">0</span><span class="hl-0">][</span><span class="hl-8">1</span><span class="hl-0">], </span><span class="hl-1">'#0a0'</span><span class="hl-0">],</span><br/><br/><span class="hl-0"> </span><span class="hl-2">// Showing the track in red</span><br/><span class="hl-0"> </span><span class="hl-5">pathStrokeColor:</span><span class="hl-0"> </span><span class="hl-1">'red'</span><span class="hl-0">,</span><br/><span class="hl-0">});</span>
|
|
207
291
|
</code></pre>
|
|
208
292
|
<p>And voila!</p>
|
|
209
293
|
<p><img src="images/screenshots/static-with-path.png" alt="static map with bike path"></p>
|
|
@@ -217,8 +301,13 @@
|
|
|
217
301
|
</a>
|
|
218
302
|
<p>NodeJS includes a stable <code>fetch()</code> function only from its version <em>18</em>, and this client does not contain a polyfill. If the <code>fetch()</code> function exists (browser or Node >= 18) then it is going to be resolved automatically, Yet, a custom <code>fetch()</code> function can be provided to the <code>config</code> object for Node < 18.</p>
|
|
219
303
|
<p>In <a href="examples/test-node.js">this NodeJS example</a>, you can see that the package <a href="https://www.npmjs.com/package/node-fetch">Node Fetch</a> has been <code>npm install</code>ed and is passed to the config object of the <em>MapTiler Client</em>.</p>
|
|
220
|
-
<pre><code class="language-js"><span class="hl-
|
|
304
|
+
<pre><code class="language-js"><span class="hl-3">import</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-5">config</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-2">// ...</span><br/><span class="hl-0">} </span><span class="hl-3">from</span><span class="hl-0"> </span><span class="hl-1">'@maptiler/client'</span><span class="hl-0">;</span><br/><br/><span class="hl-2">// For this example to work, you must bring your own node-compatible fetch,</span><br/><span class="hl-2">// unles you are using a version of Nodejs that already contains fetch (>=18)</span><br/><span class="hl-3">import</span><span class="hl-0"> </span><span class="hl-5">fetch</span><span class="hl-0"> </span><span class="hl-3">from</span><span class="hl-0"> </span><span class="hl-1">'node-fetch'</span><span class="hl-0">;</span><br/><br/><span class="hl-5">config</span><span class="hl-0">.</span><span class="hl-5">fetch</span><span class="hl-0"> = </span><span class="hl-5">fetch</span><span class="hl-0">;</span><br/><br/><span class="hl-2">// ...</span>
|
|
221
305
|
</code></pre>
|
|
306
|
+
|
|
307
|
+
<a href="#terms-and-usage-limitations" id="terms-and-usage-limitations" style="color: inherit; text-decoration: none;">
|
|
308
|
+
<h1>Terms and usage limitations</h1>
|
|
309
|
+
</a>
|
|
310
|
+
<p>The data fetched from MapTiler Cloud API, with or without this library, cannot be stored or redistributed in any ways. If you have any doubt about your specific usecase, please consult our <a href="https://www.maptiler.com/cloud/terms/">legal terms</a> or contact us at <strong><a href="mailto:sales@maptiler.com">sales@maptiler.com</a></strong> .</p>
|
|
222
311
|
</div></div>
|
|
223
312
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
224
313
|
<div class="tsd-navigation settings">
|
|
@@ -236,45 +325,17 @@
|
|
|
236
325
|
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
|
|
237
326
|
<div class="tsd-accordion-details">
|
|
238
327
|
<ul>
|
|
239
|
-
<li class="current selected"><a href="modules.html">Map<wbr/>Tiler <wbr/>Client
|
|
240
|
-
<ul></ul></li></ul></div></details></nav>
|
|
241
|
-
<nav class="tsd-navigation secondary menu-sticky">
|
|
328
|
+
<li class="current selected"><a href="modules.html">Map<wbr/>Tiler <wbr/>Client -<wbr/> v1.1.0</a>
|
|
242
329
|
<ul>
|
|
243
|
-
<li class="tsd-kind-
|
|
244
|
-
<li class="tsd-kind-
|
|
245
|
-
<li class="tsd-kind-
|
|
246
|
-
<li class="tsd-kind-
|
|
247
|
-
<li class="tsd-kind-
|
|
248
|
-
<li class="tsd-kind-
|
|
249
|
-
<li class="tsd-kind-
|
|
250
|
-
<li class="tsd-kind-
|
|
251
|
-
<li class="tsd-kind-
|
|
252
|
-
<li class="tsd-kind-type-alias"><a href="types/CoordinateSearchResult.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Coordinate<wbr/>Search<wbr/>Result</a></li>
|
|
253
|
-
<li class="tsd-kind-type-alias"><a href="types/CoordinateTransformResult.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Coordinate<wbr/>Transform<wbr/>Result</a></li>
|
|
254
|
-
<li class="tsd-kind-type-alias"><a href="types/CoordinateTransformation.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Coordinate<wbr/>Transformation</a></li>
|
|
255
|
-
<li class="tsd-kind-type-alias"><a href="types/Coordinates.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Coordinates</a></li>
|
|
256
|
-
<li class="tsd-kind-type-alias"><a href="types/CoordinatesSearchOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Coordinates<wbr/>Search<wbr/>Options</a></li>
|
|
257
|
-
<li class="tsd-kind-type-alias"><a href="types/CoordinatesTransformOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Coordinates<wbr/>Transform<wbr/>Options</a></li>
|
|
258
|
-
<li class="tsd-kind-type-alias"><a href="types/FeatureHierarchy.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Feature<wbr/>Hierarchy</a></li>
|
|
259
|
-
<li class="tsd-kind-type-alias"><a href="types/FetchFunction.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Fetch<wbr/>Function</a></li>
|
|
260
|
-
<li class="tsd-kind-type-alias"><a href="types/GeocodingFeature.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Geocoding<wbr/>Feature</a></li>
|
|
261
|
-
<li class="tsd-kind-type-alias"><a href="types/GeocodingOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Geocoding<wbr/>Options</a></li>
|
|
262
|
-
<li class="tsd-kind-type-alias"><a href="types/GeocodingSearchResult.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Geocoding<wbr/>Search<wbr/>Result</a></li>
|
|
263
|
-
<li class="tsd-kind-type-alias"><a href="types/GeolocationInfoOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Geolocation<wbr/>Info<wbr/>Options</a></li>
|
|
264
|
-
<li class="tsd-kind-type-alias"><a href="types/GeolocationResult.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Geolocation<wbr/>Result</a></li>
|
|
265
|
-
<li class="tsd-kind-type-alias"><a href="types/GetDataOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Get<wbr/>Data<wbr/>Options</a></li>
|
|
266
|
-
<li class="tsd-kind-type-alias"><a href="types/LanguageGeocodingString.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Language<wbr/>Geocoding<wbr/>String</a></li>
|
|
267
|
-
<li class="tsd-kind-type-alias"><a href="types/ReverseGeocodingOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Reverse<wbr/>Geocoding<wbr/>Options</a></li>
|
|
268
|
-
<li class="tsd-kind-type-alias"><a href="types/StaticMapBaseOptions.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Static<wbr/>Map<wbr/>Base<wbr/>Options</a></li>
|
|
269
|
-
<li class="tsd-kind-type-alias"><a href="types/StaticMapMarker.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>Static<wbr/>Map<wbr/>Marker</a></li>
|
|
270
|
-
<li class="tsd-kind-type-alias"><a href="types/XYZ.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>XYZ</a></li>
|
|
271
|
-
<li class="tsd-kind-variable"><a href="variables/LanguageGeocoding.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-32-path"></rect><path d="M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z" fill="var(--color-text)" id="icon-32-text"></path></svg>Language<wbr/>Geocoding</a></li>
|
|
272
|
-
<li class="tsd-kind-variable"><a href="variables/config.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>config</a></li>
|
|
273
|
-
<li class="tsd-kind-variable"><a href="variables/coordinates-1.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>coordinates</a></li>
|
|
274
|
-
<li class="tsd-kind-variable"><a href="variables/data.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>data</a></li>
|
|
275
|
-
<li class="tsd-kind-variable"><a href="variables/geocoding.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>geocoding</a></li>
|
|
276
|
-
<li class="tsd-kind-variable"><a href="variables/geolocation.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>geolocation</a></li>
|
|
277
|
-
<li class="tsd-kind-variable"><a href="variables/staticMaps.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-32-path"></use><use href="#icon-32-text"></use></svg>static<wbr/>Maps</a></li></ul></nav></div></div>
|
|
330
|
+
<li class="tsd-kind-module"><a href="modules/config.html">config</a></li>
|
|
331
|
+
<li class="tsd-kind-module"><a href="modules/language.html">language</a></li>
|
|
332
|
+
<li class="tsd-kind-module"><a href="modules/services_ServiceError.html">services/<wbr/>Service<wbr/>Error</a></li>
|
|
333
|
+
<li class="tsd-kind-module"><a href="modules/services_coordinates.html">services/coordinates</a></li>
|
|
334
|
+
<li class="tsd-kind-module"><a href="modules/services_data.html">services/data</a></li>
|
|
335
|
+
<li class="tsd-kind-module"><a href="modules/services_geocoding.html">services/geocoding</a></li>
|
|
336
|
+
<li class="tsd-kind-module"><a href="modules/services_geolocation.html">services/geolocation</a></li>
|
|
337
|
+
<li class="tsd-kind-module"><a href="modules/services_simplify.html">services/simplify</a></li>
|
|
338
|
+
<li class="tsd-kind-module"><a href="modules/services_staticMaps.html">services/static<wbr/>Maps</a></li></ul></li></ul></div></details></nav></div></div>
|
|
278
339
|
<div class="container tsd-generator">
|
|
279
340
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
280
341
|
<div class="overlay"></div><script src="assets/main.js"></script></body></html>
|