@maptiler/client 1.7.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/pull_request_template.md +11 -0
- package/.github/workflows/format-lint.yml +24 -0
- package/CHANGELOG.md +32 -0
- package/dist/maptiler-client.cjs +680 -306
- package/dist/maptiler-client.cjs.map +1 -1
- package/dist/maptiler-client.d.ts +270 -100
- package/dist/maptiler-client.min.mjs +1 -1
- package/dist/maptiler-client.mjs +380 -294
- package/dist/maptiler-client.mjs.map +1 -1
- package/package.json +10 -8
- package/readme.md +133 -1
- package/rollup.config.js +3 -3
- package/dist/maptiler-client.umd.js +0 -1541
- package/dist/maptiler-client.umd.js.map +0 -1
- package/dist/maptiler-client.umd.min.js +0 -1
- package/examples/test-browser-es.html +0 -103
- package/examples/test-browser-umd.html +0 -90
- package/examples/test-node.js +0 -52
- package/src/callFetch.ts +0 -18
- package/src/config.ts +0 -68
- package/src/defaults.ts +0 -11
- package/src/demProfiler/getElevation.ts +0 -46
- package/src/demProfiler/index.ts +0 -240
- package/src/demProfiler/tileCover.ts +0 -96
- package/src/geometry/area.ts +0 -96
- package/src/geometry/distance.ts +0 -45
- package/src/geometry/index.ts +0 -3
- package/src/geometry/util.ts +0 -34
- package/src/index.ts +0 -114
- package/src/language.ts +0 -87
- package/src/mapstyle.ts +0 -968
- package/src/services/ServiceError.ts +0 -13
- package/src/services/coordinates.ts +0 -263
- package/src/services/data.ts +0 -63
- package/src/services/geocoding.ts +0 -461
- package/src/services/geolocation.ts +0 -139
- package/src/services/simplify.ts +0 -87
- package/src/services/staticMaps.ts +0 -463
|
@@ -1,463 +0,0 @@
|
|
|
1
|
-
import { BBox, Position } from "geojson";
|
|
2
|
-
import { config } from "../config";
|
|
3
|
-
import { defaults } from "../defaults";
|
|
4
|
-
import { MapStyleVariant, ReferenceMapStyle, styleToStyle } from "../mapstyle";
|
|
5
|
-
import simplify from "./simplify";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Base set of options that can be provided to all the types of static maps
|
|
9
|
-
*/
|
|
10
|
-
export type StaticMapBaseOptions = {
|
|
11
|
-
/**
|
|
12
|
-
* Custom MapTiler Cloud API key to use instead of the one in global `config`
|
|
13
|
-
*/
|
|
14
|
-
apiKey?: string;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Style of the map (not full style URL). Example: "winter", "streets-v2".
|
|
18
|
-
* Default: `"streets-v2"`
|
|
19
|
-
*/
|
|
20
|
-
style?: string | ReferenceMapStyle | MapStyleVariant;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Double the size of the static map image to support hiDPI/Retina monitors.
|
|
24
|
-
* Default: `false`
|
|
25
|
-
*/
|
|
26
|
-
hiDPI?: boolean;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Image format.
|
|
30
|
-
* Default: `"png"`
|
|
31
|
-
*/
|
|
32
|
-
format?: "png" | "jpg" | "webp";
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Width of the output image. Maximum value: `2048`.
|
|
36
|
-
* Default: `1024`
|
|
37
|
-
*/
|
|
38
|
-
width?: number;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Height of the output image. Maximum value: `2048`.
|
|
42
|
-
* Default: `1024`
|
|
43
|
-
*/
|
|
44
|
-
height?: number;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Placement of the attribution. Can also be set to `false` to not show attribution.
|
|
48
|
-
* Default: `"bottomright"`
|
|
49
|
-
*/
|
|
50
|
-
attribution?: "bottomright" | "bottomleft" | "topleft" | "topright" | false;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* A marker or list of markers to show on the map
|
|
54
|
-
* Default: none provided
|
|
55
|
-
*/
|
|
56
|
-
markers?: StaticMapMarker | Array<StaticMapMarker>;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* URL of the marker image. Applies only if one or multiple markers positions are provided.
|
|
60
|
-
* Default: none provided
|
|
61
|
-
*/
|
|
62
|
-
markerIcon?: string;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Position of the marker regarding its coordinates. Applies only:
|
|
66
|
-
* - with a custom icon provided with `markerIcon`
|
|
67
|
-
* - if one or multiple markers positions are provided.
|
|
68
|
-
* Default: `"bottom"`
|
|
69
|
-
*/
|
|
70
|
-
markerAnchor?:
|
|
71
|
-
| "top"
|
|
72
|
-
| "left"
|
|
73
|
-
| "bottom"
|
|
74
|
-
| "right"
|
|
75
|
-
| "center"
|
|
76
|
-
| "topleft"
|
|
77
|
-
| "bottomleft"
|
|
78
|
-
| "topright"
|
|
79
|
-
| "bottomright";
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Draw a path or polygon on top of the map. If the path is too long it will be simplified, yet remaining accurate.
|
|
83
|
-
* Default: none provided
|
|
84
|
-
*/
|
|
85
|
-
path?: Array<Position>;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Color of the path line. The color must be CSS compatible.
|
|
89
|
-
* Examples:
|
|
90
|
-
* - long form hex without transparency `"#FF0000"` (red)
|
|
91
|
-
* - short form hex without transparency `"#F00"` (red)
|
|
92
|
-
* - long form hex with transparency `"#FF000008"` (red, half opacity)
|
|
93
|
-
* - short form hex with transparency `"#F008"` (red, half opacity)
|
|
94
|
-
* - CSS color shorthands: `"red"`, `"chartreuse"`, etc.
|
|
95
|
-
* - decimal RGB values without transparency: `"rgb(128, 100, 255)"`
|
|
96
|
-
* - decimal RGB values with transparency: `"rgb(128, 100, 255, 0.5)"`
|
|
97
|
-
* Default: `"blue"`
|
|
98
|
-
*/
|
|
99
|
-
pathStrokeColor?: string;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Color of the filling, also works if the polygon is not closed. The color must be CSS compatible.
|
|
103
|
-
* Examples:
|
|
104
|
-
* - long form hex without transparency `"#FF0000"` (red)
|
|
105
|
-
* - short form hex without transparency `"#F00"` (red)
|
|
106
|
-
* - long form hex with transparency `"#FF000008"` (red, half opacity)
|
|
107
|
-
* - short form hex with transparency `"#F008"` (red, half opacity)
|
|
108
|
-
* - CSS color shorthands: `"red"`, `"chartreuse"`, etc.
|
|
109
|
-
* - decimal RGB values without transparency: `"rgb(128, 100, 255)"`
|
|
110
|
-
* - decimal RGB values with transparency: `"rgb(128, 100, 255, 0.5)"`
|
|
111
|
-
* Default: none (transparent filling)
|
|
112
|
-
*/
|
|
113
|
-
pathFillColor?: string;
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Width of the path line in pixel. It can be floating point precision (ex: `0.5`)
|
|
117
|
-
* Default: `1` if `hiDPI` is `false` and `2` if `hiDPI` is `true`.
|
|
118
|
-
*/
|
|
119
|
-
pathWidth?: number;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Options that can be provided to centered static maps
|
|
124
|
-
*/
|
|
125
|
-
export type CenteredStaticMapOptions = StaticMapBaseOptions;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Options that can be provided to bounded static maps
|
|
129
|
-
*/
|
|
130
|
-
export type BoundedStaticMapOptions = StaticMapBaseOptions & {
|
|
131
|
-
/**
|
|
132
|
-
* Extra space added around the regio of interest, in percentage.
|
|
133
|
-
* Default: `0.1` (for 10%)
|
|
134
|
-
*/
|
|
135
|
-
padding?: number;
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Options that can be provided to automatic static maps
|
|
140
|
-
*/
|
|
141
|
-
export type AutomaticStaticMapOptions = BoundedStaticMapOptions;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Definition of a maker to show on a static map
|
|
145
|
-
*/
|
|
146
|
-
export type StaticMapMarker = [
|
|
147
|
-
/**
|
|
148
|
-
* Longitude of the marker
|
|
149
|
-
*/
|
|
150
|
-
number,
|
|
151
|
-
/**
|
|
152
|
-
* latitude of the marker
|
|
153
|
-
*/
|
|
154
|
-
number,
|
|
155
|
-
/**
|
|
156
|
-
* Color of the marker with CSS syntax. Applies only if a custom `markerIcon` is not provided.
|
|
157
|
-
*/
|
|
158
|
-
string,
|
|
159
|
-
];
|
|
160
|
-
|
|
161
|
-
function staticMapMarkerToString(
|
|
162
|
-
marker: StaticMapMarker,
|
|
163
|
-
includeColor = true,
|
|
164
|
-
): string {
|
|
165
|
-
let str = `${marker[0]},${marker[1]}`;
|
|
166
|
-
|
|
167
|
-
if (marker.length === 3 && includeColor) {
|
|
168
|
-
str += `,${marker[2]}`;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return str;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function simplifyAndStringify(path: Array<Position>, maxNbChar = 3000): string {
|
|
175
|
-
let str = path.map((point) => point.join(",")).join("|");
|
|
176
|
-
let tolerance = 0.000005;
|
|
177
|
-
const toleranceStep = 0.00001;
|
|
178
|
-
|
|
179
|
-
while (str.length > maxNbChar) {
|
|
180
|
-
const simplerPath = simplify(path, tolerance);
|
|
181
|
-
// str = simplerPath.map(point => point.join(',')).join('|');
|
|
182
|
-
str = simplerPath.map((point) => `${point[0]},${point[1]}`).join("|");
|
|
183
|
-
tolerance += toleranceStep;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return str;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Construct the URL for a static map centered on one point.
|
|
191
|
-
* Note: this function does not fetch the binary content of the image since
|
|
192
|
-
* the purpose of a static map is generally to have its URL as a `src` property of a <img/> element.
|
|
193
|
-
* If a path is provided and is too long, it will be simplified in an accurate way.
|
|
194
|
-
* @param center
|
|
195
|
-
* @param zoom
|
|
196
|
-
* @param options
|
|
197
|
-
* @returns
|
|
198
|
-
*/
|
|
199
|
-
function centered(
|
|
200
|
-
center: Position,
|
|
201
|
-
zoom: number,
|
|
202
|
-
options: CenteredStaticMapOptions = {},
|
|
203
|
-
): string {
|
|
204
|
-
const style = styleToStyle(options.style);
|
|
205
|
-
const scale = options.hiDPI ? "@2x" : "";
|
|
206
|
-
const format = options.format ?? "png";
|
|
207
|
-
let width = ~~(options.width ?? 1024);
|
|
208
|
-
let height = ~~(options.height ?? 1024);
|
|
209
|
-
|
|
210
|
-
if (options.hiDPI) {
|
|
211
|
-
width = ~~(width / 2);
|
|
212
|
-
height = ~~(height / 2);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
const endpoint = new URL(
|
|
216
|
-
`maps/${encodeURIComponent(style)}/static/${center[0]},${
|
|
217
|
-
center[1]
|
|
218
|
-
},${zoom}/${width}x${height}${scale}.${format}`,
|
|
219
|
-
defaults.maptilerApiURL,
|
|
220
|
-
);
|
|
221
|
-
|
|
222
|
-
if ("attribution" in options) {
|
|
223
|
-
endpoint.searchParams.set("attribution", options.attribution.toString());
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
if ("markers" in options) {
|
|
227
|
-
let markerStr = "";
|
|
228
|
-
|
|
229
|
-
const hasIcon = "markerIcon" in options;
|
|
230
|
-
|
|
231
|
-
if (hasIcon) {
|
|
232
|
-
markerStr += `icon:${options.markerIcon}|`;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
if (hasIcon && "markerAnchor" in options) {
|
|
236
|
-
markerStr += `anchor:${options.markerAnchor}|`;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
if (hasIcon && options.hiDPI) {
|
|
240
|
-
markerStr += `scale:2|`;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const markerList = Array.isArray(options.markers[0])
|
|
244
|
-
? options.markers
|
|
245
|
-
: [options.markers];
|
|
246
|
-
markerStr += markerList
|
|
247
|
-
.map((m) => staticMapMarkerToString(m, !hasIcon))
|
|
248
|
-
.join("|");
|
|
249
|
-
endpoint.searchParams.set("markers", markerStr);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
if ("path" in options) {
|
|
253
|
-
let pathStr = "";
|
|
254
|
-
|
|
255
|
-
pathStr += `fill:${options.pathFillColor ?? "none"}|`;
|
|
256
|
-
|
|
257
|
-
if ("pathStrokeColor" in options) {
|
|
258
|
-
pathStr += `stroke:${options.pathStrokeColor}|`;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
if ("pathWidth" in options) {
|
|
262
|
-
const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);
|
|
263
|
-
pathStr += `width:${pathWidth.toString()}|`;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
pathStr += simplifyAndStringify(options.path);
|
|
267
|
-
endpoint.searchParams.set("path", pathStr);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
endpoint.searchParams.set("key", options.apiKey ?? config.apiKey);
|
|
271
|
-
|
|
272
|
-
return endpoint.toString();
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Construct the URL for a static map using a bounding box
|
|
277
|
-
* Note: this function does not fetch the binary content of the image since
|
|
278
|
-
* the purpose of a static map is generally to have its URL as a `src` property of a <img/> element.
|
|
279
|
-
* If a path is provided and is too long, it will be simplified in an accurate way.
|
|
280
|
-
* @param boundingBox
|
|
281
|
-
* @param options
|
|
282
|
-
* @returns
|
|
283
|
-
*/
|
|
284
|
-
function bounded(
|
|
285
|
-
boundingBox: BBox,
|
|
286
|
-
options: BoundedStaticMapOptions = {},
|
|
287
|
-
): string {
|
|
288
|
-
const style = styleToStyle(options.style);
|
|
289
|
-
const scale = options.hiDPI ? "@2x" : "";
|
|
290
|
-
const format = options.format ?? "png";
|
|
291
|
-
let width = ~~(options.width ?? 1024);
|
|
292
|
-
let height = ~~(options.height ?? 1024);
|
|
293
|
-
|
|
294
|
-
if (options.hiDPI) {
|
|
295
|
-
width = ~~(width / 2);
|
|
296
|
-
height = ~~(height / 2);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
const endpoint = new URL(
|
|
300
|
-
`maps/${encodeURIComponent(style)}/static/${boundingBox[0]},${
|
|
301
|
-
boundingBox[1]
|
|
302
|
-
},${boundingBox[2]},${boundingBox[3]}/${width}x${height}${scale}.${format}`,
|
|
303
|
-
defaults.maptilerApiURL,
|
|
304
|
-
);
|
|
305
|
-
|
|
306
|
-
if ("attribution" in options) {
|
|
307
|
-
endpoint.searchParams.set("attribution", options.attribution.toString());
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
if ("padding" in options) {
|
|
311
|
-
endpoint.searchParams.set("padding", options.padding.toString());
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
if ("markers" in options) {
|
|
315
|
-
let markerStr = "";
|
|
316
|
-
|
|
317
|
-
const hasIcon = "markerIcon" in options;
|
|
318
|
-
|
|
319
|
-
if (hasIcon) {
|
|
320
|
-
markerStr += `icon:${options.markerIcon}|`;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
if (hasIcon && "markerAnchor" in options) {
|
|
324
|
-
markerStr += `anchor:${options.markerAnchor}|`;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
if (hasIcon && options.hiDPI) {
|
|
328
|
-
markerStr += `scale:2|`;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
const markerList = Array.isArray(options.markers[0])
|
|
332
|
-
? options.markers
|
|
333
|
-
: [options.markers];
|
|
334
|
-
markerStr += markerList
|
|
335
|
-
.map((m) => staticMapMarkerToString(m, !hasIcon))
|
|
336
|
-
.join("|");
|
|
337
|
-
endpoint.searchParams.set("markers", markerStr);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
if ("path" in options) {
|
|
341
|
-
let pathStr = "";
|
|
342
|
-
|
|
343
|
-
pathStr += `fill:${options.pathFillColor ?? "none"}|`;
|
|
344
|
-
|
|
345
|
-
if ("pathStrokeColor" in options) {
|
|
346
|
-
pathStr += `stroke:${options.pathStrokeColor}|`;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
if ("pathWidth" in options) {
|
|
350
|
-
const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);
|
|
351
|
-
pathStr += `width:${pathWidth.toString()}|`;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
pathStr += simplifyAndStringify(options.path);
|
|
355
|
-
endpoint.searchParams.set("path", pathStr);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
endpoint.searchParams.set("key", options.apiKey ?? config.apiKey);
|
|
359
|
-
|
|
360
|
-
return endpoint.toString();
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Construct the URL for a static map automatically fitted around the provided path or markers.
|
|
365
|
-
* Note: this function does not fetch the binary content of the image since
|
|
366
|
-
* the purpose of a static map is generally to have its URL as a `src` property of a <img/> element.
|
|
367
|
-
* If a path is provided and is too long, it will be simplified in an accurate way.
|
|
368
|
-
* @param options
|
|
369
|
-
* @returns
|
|
370
|
-
*/
|
|
371
|
-
function automatic(options: AutomaticStaticMapOptions = {}): string {
|
|
372
|
-
if (!("markers" in options) && !("path" in options)) {
|
|
373
|
-
throw new Error(
|
|
374
|
-
"Automatic static maps require markers and/or path to be created.",
|
|
375
|
-
);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
const style = styleToStyle(options.style);
|
|
379
|
-
const scale = options.hiDPI ? "@2x" : "";
|
|
380
|
-
const format = options.format ?? "png";
|
|
381
|
-
let width = ~~(options.width ?? 1024);
|
|
382
|
-
let height = ~~(options.height ?? 1024);
|
|
383
|
-
|
|
384
|
-
if (options.hiDPI) {
|
|
385
|
-
width = ~~(width / 2);
|
|
386
|
-
height = ~~(height / 2);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
const endpoint = new URL(
|
|
390
|
-
`maps/${encodeURIComponent(
|
|
391
|
-
style,
|
|
392
|
-
)}/static/auto/${width}x${height}${scale}.${format}`,
|
|
393
|
-
defaults.maptilerApiURL,
|
|
394
|
-
);
|
|
395
|
-
|
|
396
|
-
if ("attribution" in options) {
|
|
397
|
-
endpoint.searchParams.set("attribution", options.attribution.toString());
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
if ("padding" in options) {
|
|
401
|
-
endpoint.searchParams.set("padding", options.padding.toString());
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
if ("markers" in options) {
|
|
405
|
-
let markerStr = "";
|
|
406
|
-
|
|
407
|
-
const hasIcon = "markerIcon" in options;
|
|
408
|
-
|
|
409
|
-
if (hasIcon) {
|
|
410
|
-
markerStr += `icon:${options.markerIcon}|`;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
if (hasIcon && "markerAnchor" in options) {
|
|
414
|
-
markerStr += `anchor:${options.markerAnchor}|`;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
if (hasIcon && options.hiDPI) {
|
|
418
|
-
markerStr += `scale:2|`;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
const markerList = Array.isArray(options.markers[0])
|
|
422
|
-
? options.markers
|
|
423
|
-
: [options.markers];
|
|
424
|
-
markerStr += markerList
|
|
425
|
-
.map((m) => staticMapMarkerToString(m, !hasIcon))
|
|
426
|
-
.join("|");
|
|
427
|
-
endpoint.searchParams.set("markers", markerStr);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
if ("path" in options) {
|
|
431
|
-
let pathStr = "";
|
|
432
|
-
|
|
433
|
-
pathStr += `fill:${options.pathFillColor ?? "none"}|`;
|
|
434
|
-
|
|
435
|
-
if ("pathStrokeColor" in options) {
|
|
436
|
-
pathStr += `stroke:${options.pathStrokeColor}|`;
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
if ("pathWidth" in options) {
|
|
440
|
-
const pathWidth = options.pathWidth / (options.hiDPI ? 2 : 1);
|
|
441
|
-
pathStr += `width:${pathWidth.toString()}|`;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
pathStr += simplifyAndStringify(options.path);
|
|
445
|
-
endpoint.searchParams.set("path", pathStr);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
endpoint.searchParams.set("key", options.apiKey ?? config.apiKey);
|
|
449
|
-
|
|
450
|
-
return endpoint.toString();
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
* The **staticMaps** namespace contains an synchronous function build image URL of static map, as specified by the [MapTiler Static Map API](https://docs.maptiler.com/cloud/api/static-maps/).
|
|
455
|
-
* The URL of static maps can then be used within a `<img />` markup element, as the `src` property value.
|
|
456
|
-
*/
|
|
457
|
-
const staticMaps = {
|
|
458
|
-
centered,
|
|
459
|
-
bounded,
|
|
460
|
-
automatic,
|
|
461
|
-
};
|
|
462
|
-
|
|
463
|
-
export { staticMaps };
|